2 Replies Latest reply on Aug 11, 2005 10:54 AM by Daniel Serodio

    VariableInstance out of sync with DB

    Daniel Serodio Newbie

      I'm chasing a nasty bug in our app, and I've narrowed it down to the following problem with jBPM:

      I have a process variable which is updated on every TaskNode (by means of a script). At one point, when I call

      token.getProcessInstance().getContextInstance().getVariable("myVar")
      , it returns the previous value of myVar (ie, the value it had at the previous TaskNode). Looking at the database, I see the same VariableInstance with the "correct" (current) value.

      The in-memory TokenVariableMap is out-of-sync with the database. What could be causing this problem? How can I work around it?
      I tried calling
      jbpmSession.getSession().refresh(tokenVariableMap)
      inside the debugger, but it didn't make any difference.