Re: [appengine-java] Possibility for race condition on datastore?

2011-03-05 Thread Justin
Thanks for the input. Transactions is exactly what I was looking for. I coding a small game where people can attack each other and decrease their hp. If players ended up quering for the players hp and different datastores contain different values, well that's not a good thing haha. I'm planning

[appengine-java] Possibility for race condition on datastore?

2011-03-03 Thread justin
I need to write code so that a user has a counter. This counter can be read, increase, and decrease. This counter is mission critical so I will use the high replication datastore. So lets say I create a counter entity which has a user entity as the ancestor. I increase the counter value and store

Re: [appengine-java] Possibility for race condition on datastore?

2011-03-03 Thread Ikai Lan (Google)
Yes. The only way to correctly do this is with transactions and sharded counters. The better question, however, is this: what are you doing? Perhaps there is an alternative solution. Ikai Lan Developer Programs Engineer, Google App Engine Blog: http://googleappengine.blogspot.com Twitter: