5 Replies Latest reply on Oct 29, 2007 11:47 PM by lu xupan

    Concurrent access problem

    Martinus Martin Newbie

      I have a Task node where a number of task instances are created and assigned to mulpile actors. Each of these actors has his/her own task list page where they can mark the task instance as finished. However whenever more than 1 actors trying to finish the task instances, only 1 actor can actually commit the data while others will just simply hit error
      like this :


      
      19:21:56,031 [Thread-1] ERROR AbstractFlushingEventListener : Could not synchronize database state with session
      
      org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.graph.exe.Token#10168]
      
       at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1635)
      
      org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session
      
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:171)
      
       at org.jbpm.svc.Services.close(Services.java:211)
      
       at org.jbpm.JbpmContext.close(JbpmContext.java:138)
      
       at test.TestBPM$Executor.run(TestBPM.java:253)
      
      
      



      or like this :

      19:30:49,671 [Thread-0] ERROR JDBCExceptionReporter : ORA-00060: deadlock detected while waiting for resource
      
      
      
      19:30:49,671 [Thread-0] ERROR AbstractFlushingEventListener : Could not synchronize database state with session
      
      org.hibernate.exception.GenericJDBCException: could not update: [org.jbpm.graph.exe.Token#10229]
      
       at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
      
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
      
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      
       at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2222)
      
       at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2118)
      
       at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2374)
      
       at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:84)
      
       at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
      
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
      
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
      
      


      and sometimes, the program will just simply hang while trying to save the process as if it's waiting for something.


      I really need help on this, please help....please...:(


      Regards,

      Martin

        • 1. Re: Concurrent access problem
          Ronald van Kuijk Master

          - assign it to multiple actors (pooled actors)
          - it shows up in the poolerd list
          - once an actor has to perform it, assign it to that actor
          - it shows up on the personal list
          - have the actor act on it (no concurrency)
          - done....

          hth

          • 2. Re: Concurrent access problem
            Martinus Martin Newbie

            In my case actually the task instances (yes it's plural) can not be just assigned to pooled actors because each of the actors will have their own task instance of the same task. And the task has a task-end event that will change a process instance variable whenever a task instance is finished. But if more than 1 actors finished their own task instance then the errors show up. Actually this is the same as the workflow pattern no 15 MiWithAPrioriRuntimeKnowledge

            Thx anyway for your response kukeltje :)

            Regards,

            Martin

            • 3. Re: Concurrent access problem
              Ronald van Kuijk Master

              Ahhh ok, then look at the workflowpatterns testcases in the sourcecode where there (afaik) is a N out of M example. Look at www.workflowpatterns.com to see the patternnumber

              • 4. Re: Concurrent access problem
                Martinus Martin Newbie

                I've checked the pattern no 15 Wfp15MiWithAPrioriRuntimeKnowledgeTest in the jbpm test source code. But the test case was built on the assumption that the task instances are executes sequentially, one after another. In my case the task instances can be executed concurrently.

                Regards,

                Martin

                • 5. Re: Concurrent access problem
                  lu xupan Newbie

                  #### <host33> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1193713079563> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext@32d832d8 - appName: 'webapp', name: 'webapp', context-path: '/piccclaim'] Root cause of ServletException.
                  org.hibernate.exception.GenericJDBCException: could not update: [org.jbpm.graph.exe.Token#524]
                  at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
                  at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
                  at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
                  at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2360)
                  at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2242)
                  at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2542)
                  at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:92)
                  at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
                  at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
                  at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
                  at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
                  at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
                  at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)