3 Replies Latest reply on Feb 4, 2009 10:40 AM by Ronald van Kuijk

    help ,error while use timer

    sheep 277 Newbie

      this processdefinition:

      <?xml version="1.0" encoding="UTF-8"?>
      <process-definition xmlns="" name="tt">
       <start-state name="start-state1">
       <transition to="node4"></transition>
       <state name="node4">
       <timer duedate="10 second" name="aa" transition="timeout">
       System.out.println(&quot;-----------------&gt;time out&quot;);
       <transition to="fork1" name="timeout"></transition>
       <fork name="fork1">
       <transition to="join1"></transition>
       <join name="join1">
       <transition to="end-state1"></transition>
       <end-state name="end-state1"></end-state>

      while the timer 'aa' arrives the duedate,there will be a exception:

      2008-12-04 14:53:05,737 [] ERROR def.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.job.Timer#43]
      at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1765)
      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2523)
      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2697)
      at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:74)
      at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:146)
      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)
      at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
      at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
      at org.jbpm.persistence.db.DbPersistenceService.commit(DbPersistenceService.java:260)
      at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:218)
      at org.jbpm.svc.Services.close(Services.java:223)
      at org.jbpm.JbpmContext.close(JbpmContext.java:139)
      at org.jbpm.job.executor.JobExecutorThread.executeJob(JobExecutorThread.java:193)
      at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:64)

      but if the transition of the timer dosen't point to a fork,for example a state ,there won't have such exception. can angbody help me?

        • 1. Re: help ,error while use timer
          Ronald van Kuijk Master

          Sounds like a bug to me. Please create a jira issue. Also make a minimal junit testcase with embedded processdefinition that demonstrates the problem and attach that to the jira issue

          • 2. Re: help ,error while use timer
            Mingde Xu Newbie

            I have the same problem. I have not found any answer yet. It seems that there are multiple database connection (Hibernate session) accessing the same timer object (JBPM_JOB), and they become out of sync.

            The situation is even worse if you use the EJB scheduler that comes with jbpm-enterprise.jar.

            • 3. Re: help ,error while use timer
              Ronald van Kuijk Master

              we have not found an answer either since there is no testcase to demonstrate... Some issues regarding this are solved in the latest versions, but since there are no versions mentioned in these reports it is even more difficult to reproduce.... so either:
              -help us with providing more info and a testcase with everything embedded (see jbpm testcases for examples including the scheduler)
              - wait patiently untill it is (magically) resolved
              - buy commercial support and get it fixed