Transactions cross entity groups

38 views
Skip to first unread message

Cornel

unread,
Aug 7, 2009, 8:37:02 AM8/7/09
to Google App Engine
(I've posted this message one day ago but it did not appear on the
group discussion list, so i will post it again. Hope i am not spamming
or anything)


Hello. I'm using app engine to write a business application. I've read
that during a transaction one can modify only entities within the same
entity group. How would one approach the following scenario? :

Consider the "Account object" with the "Owner" and "Credit" fields.

If i want to make a credit transfer between accounts A and B
(A.credit--; B.credit++), it must be done in a single transaction.
That can only happen if A and B are in the same entity group (from
what i understand)

Since a credit transfer can be done between any two random accounts, i
must put them all in the same entity group; but this way, two
unrelated transfers (A to B and C to D let's say) cannot be done at
the same time anymore. Which again is not desired (i understand that
having a single big entity group is bad practice)

I think this is a pretty general problem (not related only to this
scenario), so how is it solved?

Jeff S (Google)

unread,
Aug 10, 2009, 7:14:23 PM8/10/09
to google-a...@googlegroups.com
Hi Cornel,

I recall a session at Google I/O from Daniel Wilkerson which describes this scenario and an approach for solving it:

http://code.google.com/events/io/sessions/DesignDistributedTransactionLayerAppEngine.html

The above describes an implementation which does not require A and B to be in the same entity group or have changes execute withing a single transaction.

Thank you,

Jeff

Craig

unread,
Oct 4, 2011, 7:35:07 AM10/4/11
to google-a...@googlegroups.com
For the benefit of anyone coming to read this thread years later, GAE 1.5.5 will be supporting cross group transactions:
Reply all
Reply to author
Forward
0 new messages