2 Replies Latest reply on Jul 25, 2012 3:44 PM by Vladimir Fishman

    jBPM persistent session ids

    Jason J Newbie

      I am using jBPM 5.2.0 and I have a question about ksession ids.  My understanding is that this session ID is used to reload a persisted session, but there is no clear indication how this is supposed to work when a server is restarted.  For example, if I have a session ID [1] for a workflow process that is persisted and the server goes down, I can reload the session back to it's previous state using this same ID.  However, how am I guaranteed that any new session ID created by the same knowledge base will be uniquely different from the persisted ID?

       

      Ex:

       

      int id = ksession.getId() ...

      startProcess(...)

       

      // server shuts down - restarts

      int savedId = geSavedId();

      session = JPAKnowledgeService.loadStatefulKnowledgeSession(savedId, kbase, null, env);

       

      newSession = kbase.newStatelessKnowledgeSession(...)

      newSession.getId() = ???

       

       

      In the above scenario, could it be possible for newSession.getId() to have the same integer value as the previously saved ID?

      If so, how would one be able to distinguish the 2 different sessions?

       

       

      Thanks for any help.