I have a GAE application that organises data using Namespaces. My question is – are Namespaces managed on a per-thread basis, or on a per-instance basis? If I enable threadsafe in the GAE configuration, is it possible that setting the namespace in one thread will affect other threads?
Share
It looks like namespaces are threadsafe on GAE/J.
This has been tested by running simple servlet that does the following:
With <threadsafe>true</threadsafe> set in appengine-web.xml all requests were handled by the same instance. This was verified by examining the number of running instances in the app engine console and by inspecting the logs for each request. Each log entry has an entry like: instance=00c61b117c8e9fd8aa8b02bff53de32a49b20e. Within the same instance, setting a namespace on a thread does not affect the namespace on other threads.
To confirm that the threadsafe setting in the configuration was working, it was set to false and the same test run. As expected, each request spun up a new instance.