1 Reply Latest reply on Jan 18, 2010 3:02 AM by Ronald van Kuijk

    jbpm 4.3 : Reentering a task that contains a reminder throws exception

    R An Newbie
      For example : in the process below, initial entry into proc1 works, transition to "checkpoint" works - but when the "checkpoint" decision transitions back to proc1, hibernate "Duplicate" exception is thrown.
      Removing the reminder element from proc1 - everything works fine.
      <?xml version="1.0" encoding="UTF-8"?>
      <process name="testfork" xmlns="http://jbpm.org/4.3/jpdl">
        <start g="16,96,48,48">
          <transition to="fork" name=""/>
        </start>
        <fork name="fork">
           <transition to="proc1" />
           <transition to="proc2" />
        </fork>
        <task name="proc1" notify="yes" priority="high" assignee="#{var.owner}" duedate="#{var.durationfromduedate}">
           <reminder duedate="2 business days" repeat="4 business hours" />
           <timer duedate="#{var.durationfromduedate}" transition="Escalate" />
           <transition to="checkpoint" name="tcheckpoint" />
        </task>
        <task name="proc2" notify="yes" priority="high" assignee="#{var.owner}">
        </task>
       
        <decision name="checkpoint" expr="#{var.status}" >
         <transition name="morework" to="proc1" />
         <transition name="alldone" to="done" />
         <transition name="moredelegatedwork" to="waitfordelegates" />
        </decision>
        <state g="96,94,111,52" name="waitfordelegates">
          <transition g="151,60:-36,11" to="checkpoint"/>
        </state>
       
        <end g="238,37,48,48" name="Escalate"/>
        <end g="238,37,48,48" name="done"/>
        <end g="238,98,48,48" name="bad request"/>
        <end g="240,160,48,48" name="internal server error"/>
       
      </process>
      ### EXCEPTION ###########################################
      11:33:30,412 SEV | [AbstractFlushingEventListener] Could not synchronize database state with session
      org.hibernate.exception.ConstraintViolationException: could not update: [org.jbpm.pvm.internal.model.ExecutionImpl#1300026]
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2453)
      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:56)
      at org.jbpm.pvm.internal.tx.StandardTransaction.commit(StandardTransaction.java:107)
      at org.jbpm.pvm.internal.tx.StandardTransaction.complete(StandardTransaction.java:64)
      at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:61)
      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
      at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
      at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
      at org.jbpm.pvm.internal.svc.TaskServiceImpl.completeTask(TaskServiceImpl.java:96)
      at Workflow.completeTask(Workflow.java:116)
      at test.main(test.java:95)
      Caused by: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry 'testfork.x1.1300016.proc1' for key 2
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
      at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2435)
      ... 20 more
      ### EXCEPTION ###########################################
      11:33:30,416 FST | [StandardTransaction] resource threw exception in prepare.  rolling back.
      11:33:30,416 FST | [StandardTransaction] rolling back resource org.jbpm.pvm.internal.tx.HibernateSessionResource@158412e1
      11:33:30,420 FIN | [HibernateSessionResource] ----- rolling back hibernate tx 2113471711 -----------------------------------------------------
      11:33:30,425 FST | [HibernateSessionResource] closing hibernate session 1459678656
      11:33:30,425 FST | [StandardTransaction] rolled back
      11:33:30,425 FST | [WireContext] closing transaction...
      11:33:30,425 FST | [BasicEnvironment] closing PvmEnvironment[1993263240]
      11:33:30,426 FST | [PvmEnvironment] closed PvmEnvironment[1993263240]
      test:ex=org.hibernate.exception.ConstraintViolationException: could not update: [org.jbpm.pvm.internal.model.ExecutionImpl#1300026]
      org.hibernate.exception.ConstraintViolationException: could not update: [org.jbpm.pvm.internal.model.ExecutionImpl#1300026]
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2453)
      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:56)
      at org.jbpm.pvm.internal.tx.StandardTransaction.commit(StandardTransaction.java:107)
      at org.jbpm.pvm.internal.tx.StandardTransaction.complete(StandardTransaction.java:64)
      at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:61)
      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
      at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
      at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
      at org.jbpm.pvm.internal.svc.TaskServiceImpl.completeTask(TaskServiceImpl.java:96)
      at Workflow.completeTask(Workflow.java:116)
      at test.main(test.java:95)
      Caused by: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry 'testfork.x1.1300016.proc1' for key 2
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
      at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2435)
      ... 20 more