13 Replies Latest reply on Sep 27, 2011 1:58 AM by uvijayreddy657

    SessionInfo and ProcessInstanceInfo tables are not getting updated when starting the process using JPAKnoweldgeService

    uvijayreddy657

      I am able to start the process and also able to store the TASK details. But SessionInfo, ProcessInstanceInfo and WorkItemInfo tables are not getting updated.

       

      Queries are being generated only to insert data only into TASK and  PEOPLEASSIGNMENTS_POTOWNERS and PEOPLEASSIGNMENTS_BAS..etc tables. But not generating insert statements to SessionInfo and ProcessInstanceInfo tables.

       

      Do we need to do any extra configurations or add extra statements to the code?

       

      Please somebody help. I am  strucked with it from past 1 week.

       

      Here is the piece of code which I am using to start the process.

       

      >

      > kbase = kbuilder.newKnowledgeBase();

      >

      >         Properties properties = new Properties();

      >         properties.put("drools.processInstanceManagerFactory", "org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory") ;

      >         properties.put("drools.processSignalManagerFactory","org.jbpm.persistence.processinstance.JPASignalManagerFactory");

      >         KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);

      >

      >         Environment env = KnowledgeBaseFactory.newEnvironment();

      >         env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);

      >         env.set(EnvironmentName.GLOBALS, new MapGlobalResolver());

      >         userTransaction = TransactionManagerServices.getTransactionManager();

      >         env.set(EnvironmentName.TRANSACTION_MANAGER, userTransaction);

      >         env.set(EnvironmentName.TRANSACTION, userTransaction);

      >        

      >         System.out.println("Loading session data ...");

      >         if (ksession != null && Integer.valueOf(ksession.getId()) != null) {

      >             try {

      >             ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(ksession.getId(), kbase, config,env);

      >             }catch (RuntimeException e) {

      >                 if (e instanceof IllegalStateException) {

      >                     Throwable cause = ((IllegalStateException) e).getCause();

      >                     if (cause instanceof InvocationTargetException) {

      >                         cause = cause.getCause();

      >                         if (cause != null && ("Could not find session data for id "+ksession.getId()).equals(cause.getMessage())) {

      >                             System.out.println("Creating new session data ...");                           

      >                             ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env);

      >                         } else {

      >                             System.err.println("Error loading session data: " + cause);

      >                             throw e;

      >                         }

      >                     } else {

      >                         System.err.println("Error loading session data:" + cause);

      >                         throw e;

      >                     }

      >                 } else {

      >                     System.err.println("Error loading session data: "  + e.getMessage());

      >                     throw e;

      >                 }

      >             }

      >         } else {

      >             ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase,config, env);

      >         }

      >    

      >         new WorkingMemoryDbLogger(ksession);

      >       ksession.getWorkItemManager().registerWorkItemHandler("Human Task",new CHumanTaskHandler());

      >

               // start the transaction

              UserTransaction ut = getUserTransaction();

               ut.begin();

      >             ksession.startProcess(processId, params);

      >

      >             // commit the transaction

      >             ut.commit();

        • 1. Re: SessionInfo and ProcessInstanceInfo tables are not getting updated when starting the process using JPAKnoweldgeService
          francesco.pietrobelli

          have you try to dispose the session before commit the transaction?

          • 2. Re: SessionInfo and ProcessInstanceInfo tables are not getting updated when starting the process using JPAKnoweldgeService
            uvijayreddy657

            I added   kession.dispose() statement. Still it is not persisting data into  ProcessInstanceInfo and SessionInfo tables.

             

            Like this:

             

            UserTransaction ut = getUserTransaction();

            ut.begin();

             

            ksession.startProcess(processId, params);

             

             

            ksession.dispose();

             

             

             

            // commit the transaction

            ut.commit();

             

             

            At the time of startProcess method invocation hibernate is generating only following queries

             

            Hibernate: select hibernate_sequence.nextval from dual

            Hibernate: select hibernate_sequence.nextval from dual

            Hibernate: select hibernate_sequence.nextval from dual

            Hibernate: select hibernate_sequence.nextval from dual

            Hibernate: select user_.id from OrganizationalEntity user_ where user_.id=?

            Hibernate: select hibernate_sequence.nextval from dual

            Hibernate: select hibernate_sequence.nextval from dual

            Hibernate: insert into Task (allowedToDelegate, taskInitiator_id, priority, activationTime, actualOwner_id, createdBy_id, createdOn, documentAccessType, documentContentId, documentType, expirationTime, faultAccessType, faultContentId, faultName, faultType, outputAccessType, outputContentId, outputType, parentId, previousStatus, processInstanceId, skipable, status, workItemId, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

            Hibernate: insert into I18NText (language, text, id) values (?, ?, ?)

            Hibernate: insert into Content (content, id) values (?, ?)

            Hibernate: update Task set allowedToDelegate=?, taskInitiator_id=?, priority=?, activationTime=?, actualOwner_id=?, createdBy_id=?, createdOn=?, documentAccessType=?, documentContentId=?, documentType=?, expirationTime=?, faultAccessType=?, faultContentId=?, faultName=?, faultType=?, outputAccessType=?, outputContentId=?, outputType=?, parentId=?, previousStatus=?, processInstanceId=?, skipable=?, status=?, workItemId=? where id=?

            Hibernate: update I18NText set Task_Names_Id=? where id=?

            Hibernate: insert into PeopleAssignments_BAs (task_id, entity_id) values (?, ?)

            Hibernate: insert into PeopleAssignments_PotOwners (task_id, entity_id) values (?, ?)

            • 3. Re: SessionInfo and ProcessInstanceInfo tables are not getting updated when starting the process using JPAKnoweldgeService
              salaboy21

              Is your process starting and finishing after the startProcess method call? If your process is ended there will not be anything to persist in the ProcessInstanceInfo table, but you should get something inside SessionInfo. Can you share the logs of your execution? You can attach the KnowledgeRuntimeLoggerFactory.newConsoleLogger(ksession); to see what is going on in the session.

              Cheers

              • 4. Re: SessionInfo and ProcessInstanceInfo tables are not getting updated when starting the process using JPAKnoweldgeService
                uvijayreddy657

                Thanks for the reply

                 

                When I debug the code I could able to see SessionInfo in the ksession but it is not getting persisted.I attached image of the SessionInfo.

                 

                This is the  ConsoleLogger stacktrace when I am starting the process

                 

                -------------> Start process------>SDSProgramme

                Loading session data ...

                Hibernate: select sessioninf0_.id as id0_0_, sessioninf0_.lastModificationDate as lastModi2_0_0_, sessioninf0_.rulesByteArray as rulesByt3_0_0_, sessioninf0_.startDate as startDate0_0_, sessioninf0_.OPTLOCK as OPTLOCK0_0_ from SessionInfo sessioninf0_ where sessioninf0_.id=?

                Creating new session data ...

                Hibernate: select hibernate_sequence.nextval from dual

                Hibernate: select hibernate_sequence.nextval from dual

                BEFORE RULEFLOW STARTED process:SDSProgramme[id=SDSProgramme]

                BEFORE PROCESS NODE TRIGGERED node:Start[id=1] process:SDSProgramme[id=SDSProgramme]

                BEFORE PROCESS NODE EXITED node:Start[id=1] process:SDSProgramme[id=SDSProgramme]

                BEFORE PROCESS NODE TRIGGERED node:FormsDesigner[id=2] process:SDSProgramme[id=SDSProgramme]

                Hibernate: select hibernate_sequence.nextval from dual

                ActorId

                TaskName

                379

                In Human Task Handler....

                AFTER PROCESS NODE TRIGGERED node:FormsDesigner[id=2] process:SDSProgramme[id=SDSProgramme]

                AFTER PROCESS NODE TRIGGERED node:Start[id=1] process:SDSProgramme[id=SDSProgramme]

                AFTER PROCESS NODE TRIGGERED node:Start[id=1] process:SDSProgramme[id=SDSProgramme]

                AFTER RULEFLOW STARTED process:SDSProgramme[id=SDSProgramme]

                Hibernate: select hibernate_sequence.nextval from dual

                Hibernate: select user_.id from OrganizationalEntity user_ where user_.id=?

                Hibernate: select hibernate_sequence.nextval from dual

                Hibernate: select hibernate_sequence.nextval from dual

                Hibernate: insert into Task (allowedToDelegate, taskInitiator_id, priority, activationTime, actualOwner_id, createdBy_id, createdOn, documentAccessType, documentContentId, documentType, expirationTime, faultAccessType, faultContentId, faultName, faultType, outputAccessType, outputContentId, outputType, parentId, previousStatus, processInstanceId, skipable, status, workItemId, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

                Hibernate: insert into I18NText (language, text, id) values (?, ?, ?)

                Hibernate: insert into Content (content, id) values (?, ?)

                Hibernate: update Task set allowedToDelegate=?, taskInitiator_id=?, priority=?, activationTime=?, actualOwner_id=?, createdBy_id=?, createdOn=?, documentAccessType=?, documentContentId=?, documentType=?, expirationTime=?, faultAccessType=?, faultContentId=?, faultName=?, faultType=?, outputAccessType=?, outputContentId=?, outputType=?, parentId=?, previousStatus=?, processInstanceId=?, skipable=?, status=?, workItemId=? where id=?

                Hibernate: update I18NText set Task_Names_Id=? where id=?

                Hibernate: insert into PeopleAssignments_BAs (task_id, entity_id) values (?, ?)

                Hibernate: insert into PeopleAssignments_PotOwners (task_id, entity_id) values (?, ?)

                 

                 

                 

                where,

                SDSProgramme - Process name

                FormsDesigner - First Human Task Node in the Workflow

                • 5. Re: SessionInfo and ProcessInstanceInfo tables are not getting updated when starting the process using JPAKnoweldgeService
                  salaboy21

                  Ok, so my first guess looking at your logs is that you are not having a persistence unit that includes the SessionInfo and the ProcessInstanceInfo entities. That will cause the omission. Are you sure that are you using the JPAKnowledgeService to create the knowledge session?

                  Cheers

                  • 6. Re: SessionInfo and ProcessInstanceInfo tables are not getting updated when starting the process using JPAKnoweldgeService
                    uvijayreddy657

                    Mauricio,

                     

                    I am including ProcessInstanceInfo, SessionInfo and WorkItemInfo in persistence.xml. I am attaching my persistence.xml here. If any modifications required please suggest me.

                     

                    I am using JPAKnowledgeService only to create session. This is the code which I am using:

                      

                    Properties properties = new Properties();

                    properties.put("drools.processInstanceManagerFactory","org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");

                    properties.put("drools.processSignalManagerFactory"

                    ,

                    "org.jbpm.persistence.processinstance.JPASignalManagerFactory");

                     

                    KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);

                     

                    kbase = kbuilder.newKnowledgeBase();

                     

                     

                     

                     

                     

                     

                     

                     

                    Environment env = KnowledgeBaseFactory.newEnvironment();

                    env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf

                    );

                    env.set(EnvironmentName.GLOBALS, new

                    MapGlobalResolver());

                    env.set(EnvironmentName.APP_SCOPED_ENTITY_MANAGER,emf.createEntityManager());

                     

                     

                    BitronixTransaction userTransaction = TransactionManagerServices.getTransactionManager();

                    env.set(EnvironmentName.TRANSACTION_MANAGER, userTransaction

                    );

                     

                    env.set(EnvironmentName.TRANSACTION, userTransaction,userTransaction);

                    StatefulKnowledgeSession  ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env);

                     

                    • 7. Re: SessionInfo and ProcessInstanceInfo tables are not getting updated when starting the process using JPAKnoweldgeService
                      salaboy21

                      Are you sure that you are doing something like:

                      Persistence.newEntityManagerFactory("

                      WFJPAPersistenceUnit"

                      );

                       

                      Somewhere to get the emf?

                       

                      Cheers

                      • 8. Re: SessionInfo and ProcessInstanceInfo tables are not getting updated when starting the process using JPAKnoweldgeService
                        uvijayreddy657

                        I am creating EntityManagerFactory object using the below piece of code

                         

                         

                        EntityManagerFactory emf = Persistence.createEntityManagerFactory("WFJPAPersistenceUnit");
                        TaskService taskService = new TaskService(emf,SystemEventListenerFactory.getSystemEventListener());
                        TaskServiceSession taskSession = taskService.createSession();

                         

                        if (taskServer == null || !taskServer.isRunning()) {
                        taskServer = new MinaTaskServer(taskService);
                        Thread thread = new Thread(taskServer);
                        thread.start();
                        }

                         

                         

                        Because of this only, other tables like TASK, Content, I18NText, PeopleAssignement_BAS..etc tables are getting inserted with Task related data.

                        • 9. Re: SessionInfo and ProcessInstanceInfo tables are not getting updated when starting the process using JPAKnoweldgeService
                          salaboy21

                          yes for some reason that is not clear here the entity manager is being shared by the task server and the Enviroment that is being used by the JPAKnowledgeService. I'm pretty sure that if you create to entity manager factories and two different persistence unit it will work as expected.

                          Cheers

                          • 10. Re: SessionInfo and ProcessInstanceInfo tables are not getting updated when starting the process using JPAKnoweldgeService
                            uvijayreddy657

                            Mauricio,

                             

                            One more thing I want to tell you  I am using Tomcat 6.0 for my development. And configured resource-ref in web.xml and also specifying DB and tranction configuration in context.xml file...

                             

                             

                            What would be the possible solution and where I am going wrong. I am stucked up with this issue from past 3 weeks. I totally digged into jbpm code as well, however couldn't find the solution..

                            • 11. Re: SessionInfo and ProcessInstanceInfo tables are not getting updated when starting the process using JPAKnoweldgeService
                              uvijayreddy657

                              Now I am creating 2 EntityManagerFactories as per the suggestion each for MinaTaskServer and Task related things. Though JPAKnowledgeService is not persisting SessionInfo and ProcessInstanceInfo.

                               

                              1) MinaTaskServer:

                              EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.task");
                              TaskService taskService = new TaskService(emf,SystemEventListenerFactory.getSystemEventListener());
                              TaskServiceSession taskSession = taskService.createSession();

                               

                              if (taskServer == null || !taskServer.isRunning()) {
                              taskServer = new MinaTaskServer(taskService);
                              Thread thread = new Thread(taskServer);
                              thread.start();
                              }

                               

                              2) for Others

                               

                              emf = Persistence.createEntityManagerFactory("WFJPAPersistenceUnit");

                               

                              Environment env = KnowledgeBaseFactory.newEnvironment();
                              env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
                              env.set(EnvironmentName.GLOBALS, new MapGlobalResolver());
                              env.set(EnvironmentName.APP_SCOPED_ENTITY_MANAGER,emf.createEntityManager());
                              userTransaction = TransactionManagerServices.getTransactionManager();
                              env.set(EnvironmentName.TRANSACTION_MANAGER, userTransaction);
                              env.set(EnvironmentName.TRANSACTION, userTransaction);

                              ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase,config, env);

                               

                              • 12. Re: SessionInfo and ProcessInstanceInfo tables are not getting updated when starting the process using JPAKnoweldgeService
                                salaboy21

                                Both persistence unit are configured against the same database?

                                This test should be working and persisting everything in the database: https://github.com/Salaboy/Drools_jBPM5-Training-Examples/blob/master/jbpm5/04-jBPM5-PersistentEmergencyServiceProcess/src/test/java/com/wordpress/salaboy/examples/PersistentEmergencyProcessTest.java

                                Take a look there and the configurations.. Cheers

                                • 13. Re: SessionInfo and ProcessInstanceInfo tables are not getting updated when starting the process using JPAKnoweldgeService
                                  uvijayreddy657

                                  Now I am getting    java.lang.IllegalStateException: A JTA EntityManager cannot use getTransaction()   exception.

                                   

                                  This time not able to persist TASK details.

                                   

                                  below is the stack trace. Please suggest me where I am going wrong.

                                   

                                   

                                  -------------> Start process------>BBC

                                  Hibernate: select task0_.id as col_0_0_, deadline1_.id as col_1_0_, deadline1_.deadline_date as col_2_0_ from Task task0_, Deadline deadline1_ where (deadline1_.id in (select startdeadl2_.id from Deadline startdeadl2_ where task0_.id=startdeadl2_.Deadlines_StartDeadLine_Id) or deadline1_.id in (select enddeadlin3_.id from Deadline enddeadlin3_ where task0_.id=enddeadlin3_.Deadlines_EndDeadLine_Id)) and deadline1_.escalated=0 order by deadline1_.deadline_date

                                  (null: 2, 538): cvc-datatype-valid.1.2.1: '4cbb5f99-a5e5-4f49-8295-0e399379822c' is not a valid value for 'NCName'.

                                  (null: 2, 538): cvc-attribute.3: The value '4cbb5f99-a5e5-4f49-8295-0e399379822c' of attribute 'id' on element 'bpmn2:definitions' is not valid with respect to its type, 'ID'.

                                  creating ksession ...

                                  SLF4J: Failed to load class "org.slf4j.impl.StaticMDCBinder".

                                  SLF4J: Defaulting to no-operation MDCAdapter implementation.

                                  SLF4J: See http://www.slf4j.org/codes.html#no_static_mdc_binder for further details.

                                  Hibernate: select hibernate_sequence.nextval from dual

                                  Hibernate: insert into SessionInfo (lastModificationDate, rulesByteArray, startDate, OPTLOCK, id) values (?, ?, ?, ?, ?)

                                  Hibernate: select hibernate_sequence.nextval from dual

                                  Hibernate: select hibernate_sequence.nextval from dual

                                  BEFORE RULEFLOW STARTED process:BBC[id=BBC]

                                  Hibernate: select hibernate_sequence.nextval from dual

                                  BEFORE PROCESS NODE TRIGGERED node:Start[id=1] process:BBC[id=BBC]

                                  Hibernate: select hibernate_sequence.nextval from dual

                                  BEFORE PROCESS NODE EXITED node:Start[id=1] process:BBC[id=BBC]

                                  Hibernate: select hibernate_sequence.nextval from dual

                                  BEFORE PROCESS NODE TRIGGERED node:Step1[id=2] process:BBC[id=BBC]

                                  Hibernate: select hibernate_sequence.nextval from dual

                                  AFTER PROCESS NODE TRIGGERED node:Step1[id=2] process:BBC[id=BBC]

                                  AFTER PROCESS NODE TRIGGERED node:Start[id=1] process:BBC[id=BBC]

                                  AFTER PROCESS NODE TRIGGERED node:Start[id=1] process:BBC[id=BBC]

                                  AFTER RULEFLOW STARTED process:BBC[id=BBC]

                                  java.lang.IllegalStateException: A JTA EntityManager cannot use getTransaction()

                                      at org.hibernate.ejb.AbstractEntityManagerImpl.getTransaction(AbstractEntityManagerImpl.java:324)

                                      at org.jbpm.task.service.TaskServiceSession.doOperationInTransaction(TaskServiceSession.java:811)

                                      at org.jbpm.task.service.TaskServiceSession.addTask(TaskServiceSession.java:134)

                                      at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:109)

                                      at org.jbpm.task.service.mina.MinaTaskServerHandler.messageReceived(MinaTaskServerHandler.java:41)

                                      at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:713)

                                      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                                      at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                                      at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)

                                      at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:375)

                                      at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:229)

                                      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                                      at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                                      at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)

                                      at org.apache.mina.filter.logging.LoggingFilter.messageReceived(LoggingFilter.java:176)

                                      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                                      at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                                      at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)

                                      at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)

                                      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                                      at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)

                                      at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:638)

                                      at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:598)

                                      at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:587)

                                      at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:61)

                                      at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:969)

                                      at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)

                                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)

                                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)

                                      at java.lang.Thread.run(Thread.java:619)

                                  Hibernate: insert into ProcessInstanceInfo (lastModificationDate, lastReadDate, processId, processInstanceByteArray, startDate, state, OPTLOCK, InstanceId) values (?, ?, ?, ?, ?, ?, ?, ?)

                                  Hibernate: insert into ProcessInstanceLog (end_date, processId, processInstanceId, start_date, id) values (?, ?, ?, ?, ?)

                                  Hibernate: insert into NodeInstanceLog (log_date, nodeId, nodeInstanceId, nodeName, processId, processInstanceId, type, id) values (?, ?, ?, ?, ?, ?, ?, ?)

                                  Hibernate: insert into NodeInstanceLog (log_date, nodeId, nodeInstanceId, nodeName, processId, processInstanceId, type, id) values (?, ?, ?, ?, ?, ?, ?, ?)

                                  Hibernate: insert into NodeInstanceLog (log_date, nodeId, nodeInstanceId, nodeName, processId, processInstanceId, type, id) values (?, ?, ?, ?, ?, ?, ?, ?)

                                  Hibernate: insert into WorkItemInfo (creationDate, name, processInstanceId, state, OPTLOCK, workItemByteArray, workItemId) values (?, ?, ?, ?, ?, ?, ?)

                                  Hibernate: update ProcessInstanceInfo set lastModificationDate=?, lastReadDate=?, processId=?, processInstanceByteArray=?, startDate=?, state=?, OPTLOCK=? where InstanceId=? and OPTLOCK=?

                                  Hibernate: update WorkItemInfo set creationDate=?, name=?, processInstanceId=?, state=?, OPTLOCK=?, workItemByteArray=? where workItemId=? and OPTLOCK=?

                                  Hibernate: update SessionInfo set lastModificationDate=?, rulesByteArray=?, startDate=?, OPTLOCK=? where id=? and OPTLOCK=?

                                  Hibernate: update SessionInfo set lastModificationDate=?, rulesByteArray=?, startDate=?, OPTLOCK=? where id=? and OPTLOCK=?