On Wed, Jun 12, 2013 at 4:50 PM, Albert Padin <[email protected]> wrote:
> > Are you saying that even if the db.get(key_of_marker) returns None in step > 1, step 5 will return an exception if an entity of the same key was created > in another transaction that happened between steps 2 - 4 of the original > transaction? > Yes. It's optimistic currency control + serializable isolation. Optimistic currency control means another txn can complete between 1 and 5. The alternative is locking, which would have prevented that (but has other limitations). Serializable isolation within txn means if txn read data that has been changed between txn begin and end, it fails and has to retry. > Is the following Transaction A doomed to fail? > > > ... > Yes, it will raise an exception. > I just want to be 100% certain that my transactions either completely fail > or completely succeed AND NEVER EVER repeat. > In that case I suggest you test it for yourself as well. It should be instructive to see it in action, and would help you sleep better at night. ;) Make a handler for txn A that starts txn, reads, sleeps, writes 'txn A', and a different handler B that writes 'txn B'. Point browser to handler A then handler B before request A ends and see if A raises exception. Note that if B has to start a new instance, A might complete before B, in that case just try again. -- Helge Tesdal Senior Developer - mCASH Norge AS +47 815 10 150 http://mCA.SH -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-appengine?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
