I am attempting to use GAEs namespace feature to build a multi tenant application. The basic design is:
Vaadin application starts up and displays login page. Session is created and stored in datastore under default namespace.
User enters username and password.
Authentication class looks up User record. The namespace that the user belongs to is stored on the User record.
Authenticator changes the application namespace (NamespaceManager.set(user.getNamespace()).
The problem here is that once the users namespace is set the session record is no longer accessible because it is stored in the default namespace.
The two solutions I see to this problem are:
Set the namespace temporarily for each of my business logic datastore operation and then set back to the default namespace in a finally block. (Not really an option)
Set the namespace temporarily for each session record read/write operation and then set back to the users namespace in a finally block. This is ideal but would require a change to Vaadin code.
I am thinking of modifying com.vaadin.terminal.gwt.server.GAEApplicationServlet to implement solution 2 (see post above). I am following
this google resource as a guide.
Can you see any possible issues with this kind of change?