Providing serialization processing for each user's request processing in GAE / J

The default mode for google appengine by default is that each instance works in single-thread mode. They handle concurrent requests, creating new JVM instances, if necessary.

A new switch , though, allows appengine to process multiple requests in parallel in one instance.

What I have done so far in regularly hosted Java web applications in order to guarantee the security of threads between requests of the same user was to synchronize in the http session (or on the value stored in the session). Spring does this (using a flag synchronizeOnSession).

This is not possible in GAE because HttpSession (along with all the variables it stores) is always new in every HTTP request. That is, the hash code is always different. Therefore, synchronization on this has no effect. But even if this is possible, appengine does not guarantee that two requests from the same user will be processed by the same instance (something like a sticky session).

The new appengine flag warns that:

If you want to use concurrent requests, the requirements for your application to use the correct synchronization of threads before turning it on.

, , ? , , http. , , .

+3
1

:

  • , javascript. .

  • GAE , , .

  • , , ( ). GAE Datastore. .

+2

All Articles