[google-appengine] Once-only transactions

2012-01-19 Thread Jeff Schnitzer
I'd like to guarantee a transaction runs once, and once only. Let's say I'm simulating a bank transfer of $5 from AccountA to AccountB. The normal transaction is not idempotent: Repeat until success { * start txn * debit $5 from AccountA * credit $5 to AccountB * commit txn } If this

Re: [google-appengine] Once-only transactions

2012-01-19 Thread Robert Kluin
Hey Jeff, That is more-or-less the best I've come up with as well. My flow looks like: 1) produce a transaction marker entity with a deterministic key-name from the involved accounts, 2) Start transaction: 2.a) Load the involved entities (including the marker). 2.b) If I get a