Hi,

There seems to be an inconsistency in the documented semantics of
transactions.

The datastore documentation(http://code.google.com/appengine/docs/
datastore/transactions.html) says:

"
The example above demonstrates one use of transactions: updating an
entity with a new property value relative to its current value.

def increment_counter(key, amount):
  obj = db.get(key)
  obj.counter += amount
  obj.put()

This requires a transaction because the value may be updated by
another user after this user's request calls db.get(key) but before it
calls obj.put(). Without a transaction, the user's request will use
the value of obj.counter prior to the update, and obj.put() will
overwrite the update. With a transaction, the entity is guaranteed not
to change between the two calls. If the entity is updated during the
transaction, then the transaction is retried until all steps are
completed without interruption.
"

However the article 
http://code.google.com/appengine/articles/transaction_isolation.html
gives the impression that the transaction isolation level is read
committed.  That would imply that another concurrent transaction
*could* update the counter value after the get, but before the put
(even inside a transaction).

Would someone mind clarifying this for me?  Is the counter example
above guaranteed to atomically update the counter if it succeeds?  If
that is the case, then I think the isolation level article is a bit
misleading, because the isolation level would be closer to
serializable.

Cheers,
Ian.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to