[jboss-user] [JBoss jBPM] - Re: jBPM 3.3.0GA and Oracle causing StaleObjectStateExceptio

Olivier_Debels do-not-reply at jboss.com
Thu Jan 8 05:09:31 EST 2009

Digged into it a bit further.

Seems to me that there are cases for which FORCE lock will never work.

Let me try to explain:

If you have a process with a fork join where the parallel branches contain a node which performs a query.  

If you can run from start to the join in the same transaction you get into trouble with the FORCE lock.

What happens is:

- Main token gets created and persisted - version is 0
- Fork join is triggered, 2 child tokens are created.
- when query is performed in a node in one of the branches, an auto flush is done.  This will increment the version of the parent lock to 1, since this one changed since the beginning of the process (some dates are filled in,...)
- When you arrive in the fork, the lock will try to increase the version to 1, which fails since it is already 1.

So my problem was not related to any bug in oracle but just due to the default locking and the fact that in my unit test I run through the complete process in one transaction.

In these cases you need to set lock to upgrade.

In other cases you can leave the default locking (force lock).

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

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

More information about the jboss-user mailing list