[jboss-user] [JBoss jBPM] - Token lock issue

firetruck do-not-reply at jboss.com
Thu Dec 4 06:11:13 EST 2008


I have an issue with locking a Token.

When an action starts to execute inside a Node, I lock the token with the method lock() from the Token object. That's to avoid the use of it, while the action is executing.

Then, in another part of my code, i try to verify if the token is locked. I do this:

Token token= jbpmContext.loadToken(processInstance.getRootToken().getId());
  |             if(token.isLocked()){
  |                      ...
  |             }
  | 

My problem is that when I load the token to check if it is locked, I don't get the same object that I locked in the Node. Instead, the token seems to be reloaded from database, and when it happens, the value of isLocked is lost, because it is a transient attribute.

How should I do to load the exactly same object that I had previously locked in the Node?

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

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



More information about the jboss-user mailing list