mc06050145 Iram Khan
Sun, 14 Mar 2010 14:51:04 -0700
On Sun, Mar 14, 2010 at 5:53 PM, B <boris....@gmail.com> wrote:
> If I passed a list of key ids as an argument in a transaction, would
> the change associated with the first key in the list happen first? And
> if not, how do I specify the order that I want the changes to happen
> in?
>
> As a concrete example, consider this code below from Google
> Docshttp://
> code.google.com/appengine/docs/python/datastore/transactions.html---would
> changes to the first item in acc.key() happen first?
>
> class Accumulator(db.Model):
> counter = db.IntegerProperty()
>
> Docshttp://
> code.google.com/appengine/docs/python/datastore/transactions.html:
> def increment_counter(key, amount):
> obj = db.get(key)
> obj.counter += amount
> obj.put()
>
> q = db.GqlQuery("SELECT * FROM Accumulator")
> acc = q.get()
> db.run_in_transaction(increment_counter, acc.key(), 5)
>
>
>
> --
> 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-appeng...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine+unsubscr...@googlegroups.com<google-appengine%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>
-- 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-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.