2 Replies Latest reply on Dec 4, 2008 7:18 AM by Rodrigo Carandina

    Token lock issue

    Rodrigo Carandina Newbie

      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?