[jboss-user] [JBoss jBPM] - Re: StaleObjectStateException in a Fork with states

tak2 do-not-reply at jboss.com
Fri Mar 14 22:36:02 EDT 2008

Was this issue for the join with multi-threads fixed?
I am facing same issue, too.

My application server is Oracle, IBM, and Fujitsu with Oracle 10g DB.
I have two parallel asynchronous nodes between fork and join, and these node are executed by different thread via MDB.

Here is what I understood from code so far.
In execute method in Join node, when it call session.lock(parentToken, LockMode.FORCE), hibernate seems like incrementing version (why for locking???), and same operation to the same object in another thread throw StaleObjectStateException.
This is basic feature we need for concurrent operation, and very easy to implement with SQL based programming with "select for update".

I tried to LockMode.UPGRADE, but it's same.

So, I tried to called "select for update" against parent Token record instead of using session.lock(), and this operation worked as I expected, but when committing transaction on JbpmContext.close(), later thread still throw StaleObjectStateException.

OK, then I load object after getting lock (after select for update) by session.load(parentToken.getId(), Token.class, LockMode.UPGRADE), but surprisingly the parentToken object returned still had old version, even DB record was committed and version was incremented. 

Does someone solve this issue?
or am I doing something wrong?

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

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

More information about the jboss-user mailing list