[appengine-java] Re: Concurrency In Transaction

2009-10-27 Thread ted stockwell
On Oct 27, 1:35 pm, yccheok wrote: > > (Now, I assume there will be only one servlet instance in entire web > environment. Multiple thread will be spawn to access the code in the > one servlet instance, for multiple web request.) > That is not a valid assumption. There may be more than one ins

[appengine-java] Re: Concurrency In Transaction

2009-10-28 Thread leszek
http://code.google.com/intl/pl/appengine/docs/java/datastore/transactions.html Look at the next code snippet === for (int i = 0; i < NUM_RETRIES; i++) { pm.currentTransaction().begin(); ClubMembers members = pm.getObjectById(ClubMembers.class, "k12345");

[appengine-java] Re: Concurrency In Transaction

2009-11-17 Thread ted stockwell
On Nov 17, 2:59 pm, Rusty Wright wrote: > Is there some way to pause before retrying the database transaction?  If you > don't, then it seems to me that the processes that are banging into each > other are going to keep failing.  I'd like to add a pause for a random amount > of time in the ca

[appengine-java] Re: Concurrency In Transaction

2009-11-18 Thread ted stockwell
On Nov 17, 10:27 pm, Rusty Wright wrote: > Ah, thanks.  So if I knew how many servers my cloud is made of then I should > use that number for my MAX_RETRIES.  ;-) > > I'm curious about how others are handling the exceptions.  The > JDOCanRetryException is subclassed by other exceptions that do

Re: [appengine-java] Re: Concurrency In Transaction

2009-11-17 Thread Rusty Wright
Is there some way to pause before retrying the database transaction? If you don't, then it seems to me that the processes that are banging into each other are going to keep failing. I'd like to add a pause for a random amount of time in the catch block. leszek wrote: > http://code.google.com

Re: [appengine-java] Re: Concurrency In Transaction

2009-11-17 Thread Rusty Wright
Ah, thanks. So if I knew how many servers my cloud is made of then I should use that number for my MAX_RETRIES. ;-) I'm curious about how others are handling the exceptions. The JDOCanRetryException is subclassed by other exceptions that don't seem like things I'd want to retry, but perhaps

Re: [appengine-java] Re: Concurrency In Transaction

2009-11-17 Thread Rusty Wright
I think my try/catch is missing a catch at the end: catch (final Throwable ex) { exception = ex; break; // fail } Rusty Wright wrote: > Ah, thanks. So if I knew how many servers my cloud is made of then I > should use that number for my

Re: [appengine-java] Re: Concurrency In Transaction

2009-11-18 Thread Rusty Wright
Excellent; thanks. I also took out the "uber catch" I was thinking I needed; it was late at night and I was awash in catch blocks. ted stockwell wrote: > > On Nov 17, 10:27 pm, Rusty Wright wrote: >> Ah, thanks. So if I knew how many servers my cloud is made of then I should >> use that num