Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-2331

StaleObjectException on Timer execution.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • jBPM 4.0
    • jBPM 4.0.CR1
    • Runtime Engine
    • None

    Description

      A StaleObjectException is thrown on the flush of the ExecuteJobCmd execution. It appears that Hibernate is trying to update the Job record at flush time despite it having been deleted earlier in the transaction.

      Adding a repeat to the timer definition means that the timer does not try to delete itself allowing the job to execute without an error.

      ERROR:org.hibernate.event.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.pvm.internal.job.TimerImpl#3
      at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1792)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2435)
      at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2335)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2635)
      at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:115)
      at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)
      at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
      at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
      at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)
      at org.jbpm.pvm.internal.tx.HibernateSessionResource.prepare(HibernateSessionResource.java:54)
      at org.jbpm.pvm.internal.tx.StandardTransaction.commit(StandardTransaction.java:106)
      at org.jbpm.pvm.internal.tx.StandardTransaction.complete(StandardTransaction.java:65)
      at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:61)
      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:54)
      at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
      at org.jbpm.pvm.internal.jobexecutor.JobExecutorThread.run(JobExecutorThread.java:63)

      <process key="TimerTest" name="Timer Test">
      <start name="thestart">
      <transition to="wait"/>
      </start>
      <state name="wait">
      <transition name="timeout" to="end">
      <timer duedate="30 seconds"/>
      </transition>
      </state>
      <end name="end"/>
      </process>

      Attachments

        Activity

          People

            jbarrez Joram Barrez (Inactive)
            bixby_jira Phil Bingley (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: