Hi guys:
I'm creating an app that I need to deal with concurrent modification of object.
Given I have an object that I need to store on memcache.
Now, given my user base would be big enough for two request to arrive simultaneously at two different servers in the cloud. So, in order to modify the object, the server #1 that receive request fetch the object from memcache (Correct me if I'm wrong: this will deserialized raw data on memcache in to Java Object on Server #1 JVM), modify it and then put it back to memcache (which in turn serialize the object).
At the same time, server #2 tried to modify the object on memcache.

Under this scenario: Server #1 fetch object> Server #2 fetch object > Server #1 store object > Server #2 store object
Then all changes make by Server #1 will be overrided by Server #2.

If these 2 requests happen on the same Server (and in effect, the same JVM), then I believe the use of synchronized access will help. But in case they happen on different server, then I don't know how to handle them yet.

Would you guys advice me on that?
Thanks.

--
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to