Transactions and queries in python app engine

41 views
Skip to first unread message

FastGeert

unread,
Jul 9, 2012, 9:07:12 AM7/9/12
to google-a...@googlegroups.com
Hi,

is it possible to perform non-transactional datastore queries from inside a transaction?

In the java version of appengine, it is possible, but as far as I read in the python documentation, I don't think it is possible in the python version of appengine.


pdknsk

unread,
Jul 9, 2012, 10:28:30 AM7/9/12
to Google App Engine
I don't know if it's documented, but it was mentioned in the release
notes.

The Datastore API now includes a NonTransactional decorator to ensure
that a function is run outside of a transaction. Existing transactions
are paused while the function is executing.

Guido van Rossum

unread,
Jul 9, 2012, 5:08:55 PM7/9/12
to google-a...@googlegroups.com
Also, in NDB you can run multiple transactions as well as non-transactional code "concurrently" using the propagation option to transaction() or @transactional(), or the @non_transactional decorator. (I put "concurrently" in parentheses since this is not a multi-threading API but simply uses NDB's async I/O facilities.)

See the docs at https://developers.google.com/appengine/docs/python/ndb/transactions (which sadly misspell this flag as "propogation". I will fix this.)
Reply all
Reply to author
Forward
0 new messages