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