According to the docs, the namespace is set globally within the app,
but you can use
it "On a per-User Basis" for users that are logged in as an example
and that user
is the tenant.  The docs aren't clear, but the namespace must be
globally just for that
tenant, yes?   If that's the case, then you wouldn't need to worry
about concurrent access.
You could make a quick test with 2 users and different namespaces...



On May 13, 11:55 pm, Aswath Satrasala <aswath.satras...@gmail.com>
wrote:
> Namespace-api is set normally in a Servlet Filter, which is normally the
> beginning point for most application HttpRequests.  This means, there is a
> request coming in, it is serviced by a single-thread.  Namespace-api is
> threadsafe and the namespace is put in the threadlocal, and hence, the same
> namespace is available during the complete HttpRequest serviced by that
> thread.
>
> -Aswath
>
> On Fri, May 13, 2011 at 9:13 PM, mpire
> <sebastian.wennin...@googlemail.com>wrote:
>
>
>
> > Hi!
>
> > I'm trying to use the Namespace-API to build a multi-tenant app.
> > Therefore i have defined a filter that sets the Namespace for each request
> > regarding to the User making the request.
> > However, if there's a new Request before the current request finishes its
> > datastore-operation, the namespace would be overwritten by the new request
> > and the current operation would have an incorrect namespace.
> > I could also set the namespace before each datastore operation, but the
> > problem would be the same.If another request overwrites the namespace before
> > the operation is finished, the data in the database will be messed.
> > Is there a way to set the namespace for an entire request?
> > Or should i try to build some kind of Mutex around the NamespaceManager?
>
> > Any suggestions to solve this problem are welcome :)
>
> > Thx in advance
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> > google-appengine-java@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to