I've implemented a set of distributed locks for GAE that I posted a message about previously (especially note the current limitations of reliability of shared/read locks):
http://groups.google.com/group/google-appengine-java/browse_thread/thread/6abc2092fc3870be/d495d9d82abbf912?lnk=gst&q=lock#d495d9d82abbf912 Here's a direct link to the source code: http://code.google.com/p/gaevfs/source/browse/trunk/src/com/newatlanta/appengine/locks/ Since posting that message, I've done some timings on memcache calls and found that they usually take about 15ms; I've seen low times around 6-7ms and high times as much as 60ms. The ExclusiveLock is the most efficient, since it takes only one memcache call to acquire and one to release. If you use the ReadWriteLock class, it takes two memcache calls to acquire a write lock, and three memcache calls to acquire a read lock (it only takes one memcache call to release either a write or read lock). So, while using ReadWriteLock allows the greatest concurrency in your application, unless the read operations take longer than 45ms on average, you might be better off using ExclusiveLocks. Let me know if you find this useful. Vince On Wed, Aug 26, 2009 at 10:31 AM, randal<rdgo...@gmail.com> wrote: > > Hello. > > I'm trying to create a service method that encapsulates a particular > business logic. I want to make this feature transactional such that > its job is accomplished atomically(?). The problem is the service > logic involves accessing different entities that do not belong to the > same entity group which is not allowed in GAE. > > At the moment, I've temporarily disabled transaction management to the > service method. However, I feel I'd need to manage transactions > eventually. I'm thinking of revising the model design but from how I > see it, the model classes are good as they are--unrelated by > ownership. > > Btw, within the service logic is some methods that are transactional. > I'm using Spring framework to annotate transaction management. > > Can anyone help me on how I can go about this? > > 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 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 -~----------~----~----~----~------~----~------~--~---