[jboss-user] [jBPM Users] - Re: takeTask() race condition

saraswati.santanu do-not-reply at jboss.com
Sat Nov 14 00:36:56 EST 2009


Actually your assumption that the first user who executes step 3 wins is not always correct. May be most of the time it happens that way for your case. 

It has to be that the first of the two treads which does a hibernateSession.flush() will win. This is a desired behaviour from hibernate, and this is a very important feature.

I think the solution you thought of catching StaleObjectStateException is fair enough. Make sure that your "try" boundary is the smallest possible so that you do not catch StaleObjectStateException happening because of some other reason.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4265649#4265649

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4265649



More information about the jboss-user mailing list