3 Replies Latest reply on Jan 6, 2011 2:04 PM by Chris Williams

    jBpm4.4 +spring test error(Could not synchronize database state with session)?

    wu arron Newbie

      I use the jBpm4.4. install with spring,do like this:

       

      I modify the build.xml file 187 line for create.cfg target.and change the tx to "spring",then ant create.cfg.I get the cfg files and copy all the files to example classpath.I Junit the AsyncActivityTest.java.

      and get the error:

       


      11:17:29,453 FIN | [AsyncActivityTest] === starting testAsyncActivity =============================
      11:17:29,703 FIN | [ProcessDefinitionImpl] creating new execution for process 'AsyncActivity'
      11:17:29,703 FIN | [DatabaseIdComposer] generated execution id AsyncActivity.30013
      11:17:29,718 FIN | [ExecuteActivity] executing activity(22142166)
      11:17:29,718 FIN | [JobExecutorMessageSession] sending message ExecuteActivityMessage
      11:17:29,796 FIN | [ExecuteJobCmd] executing job ExecuteActivityMessage[30014]...
      11:17:29,812 FIN | [ExecuteActivity] executing activity(generate pdf)
      11:17:29,812 FIN   | [DispatcherThread] submitting jobs [30014]
      11:17:29,843 FIN   | [DispatcherThread] added jobs [30014] to the queue
      11:17:29,859 FIN     | [ExecuteJobCmd] executing job ExecuteActivityMessage[30014]...
      11:17:29,859 FIN     | [ExecuteActivity] executing activity(generate pdf)
      log4j:WARN No appenders could be found for logger (org.jbpm.examples.async.activity.Application).
      log4j:WARN Please initialize the log4j system properly.
      log4j:WARN No appenders could be found for logger (org.jbpm.examples.async.activity.Application).
      log4j:WARN Please initialize the log4j system properly.
      11:17:29,890 FIN | [JobExecutorMessageSession] sending message ExecuteActivityMessage
      11:17:29,890 FIN | [ExecuteJobCmd] executed job ExecuteActivityMessage[30014]
      11:17:29,953 FIN     | [JobExecutorMessageSession] sending message ExecuteActivityMessage
      11:17:29,953 FIN     | [ExecuteJobCmd] executed job ExecuteActivityMessage[30014]
      ### EXCEPTION ###########################################
      11:17:29,953 SEV     | [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.model.ExecutionImpl#30013]
          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.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:365)
          at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)
          at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:656)
          at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
          at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
          at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:147)
          at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:49)
          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:56)
          at org.jbpm.pvm.internal.jobexecutor.JobParcel.run(JobParcel.java:48)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
          at java.util.concurrent.FutureTask.run(FutureTask.java:123)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
          at java.lang.Thread.run(Thread.java:595)
      ### EXCEPTION ###########################################
      11:17:30,031 FIN   | [DispatcherThread] submitting jobs [30016]
      11:17:30,031 FIN   | [DispatcherThread] added jobs [30016] to the queue
      11:17:30,046 FIN | [ExecuteJobCmd] executing job ExecuteActivityMessage[30016]...
      11:17:30,046 FIN | [ExecuteActivity] executing activity(calculate primes)
      11:17:30,062 FIN | [ExecuteActivity] executing activity(end)
      11:17:30,062 FIN | [ExecutionImpl] execution[AsyncActivity.30013] ends with state ended
      11:17:30,062 FIN | [DbSessionImpl] Deleting process instance AsyncActivity.30013
      11:17:30,078 FIN       | [ExecuteJobCmd] executing job ExecuteActivityMessage[30016]...
      11:17:30,078 FIN | [ExecuteJobCmd] executed job ExecuteActivityMessage[30016]
      11:17:30,078 FIN       | [ExecuteActivity] executing activity(calculate primes)
      11:17:30,078 FIN       | [ExecuteActivity] executing activity(end)
      11:17:30,078 FIN       | [ExecutionImpl] execution[AsyncActivity.30013] ends with state ended
      ### EXCEPTION ###########################################
      11:17:30,078 SEV       | [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.model.ExecutionImpl#30013]
          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.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:64)
          at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:996)
          at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1141)
          at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
          at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:835)
          at org.jbpm.pvm.internal.hibernate.DbSessionImpl.findProcessInstanceByIdIgnoreSuspended(DbSessionImpl.java:148)
          at org.jbpm.pvm.internal.hibernate.DbSessionImpl.deleteProcessInstance(DbSessionImpl.java:185)
          at org.jbpm.pvm.internal.model.ExecutionImpl.end(ExecutionImpl.java:396)
          at org.jbpm.jpdl.internal.activity.EndActivity.execute(EndActivity.java:81)
          at org.jbpm.jpdl.internal.activity.EndActivity.execute(EndActivity.java:43)
          at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
          at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:672)
          at org.jbpm.pvm.internal.model.op.ExecuteActivityMessage.executeVoid(ExecuteActivityMessage.java:45)
          at org.jbpm.pvm.internal.job.MessageImpl.execute(MessageImpl.java:46)
          at org.jbpm.pvm.internal.job.MessageImpl.execute(MessageImpl.java:32)
          at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:79)
          at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:41)
          at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
          at org.jbpm.pvm.internal.tx.SpringCommandCallback.doInTransaction(SpringCommandCallback.java:45)
          at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
          at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:49)
          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:56)
          at org.jbpm.pvm.internal.jobexecutor.JobParcel.run(JobParcel.java:48)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
          at java.util.concurrent.FutureTask.run(FutureTask.java:123)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
          at java.lang.Thread.run(Thread.java:595)
      ### EXCEPTION ###########################################
      11:17:30,093 FIN     | [ExecuteJobCmd] job 30014 no longer exists
      ### EXCEPTION ###########################################
      11:17:30,093 SEV       | [ExecuteJobCmd] exception while executing 'ExecuteActivityMessage[30016]'
      org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.pvm.internal.model.ExecutionImpl#30013]
          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.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:64)
          at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:996)
          at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1141)
          at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
          at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:835)
          at org.jbpm.pvm.internal.hibernate.DbSessionImpl.findProcessInstanceByIdIgnoreSuspended(DbSessionImpl.java:148)
          at org.jbpm.pvm.internal.hibernate.DbSessionImpl.deleteProcessInstance(DbSessionImpl.java:185)
          at org.jbpm.pvm.internal.model.ExecutionImpl.end(ExecutionImpl.java:396)
          at org.jbpm.jpdl.internal.activity.EndActivity.execute(EndActivity.java:81)
          at org.jbpm.jpdl.internal.activity.EndActivity.execute(EndActivity.java:43)
          at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
          at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:672)
          at org.jbpm.pvm.internal.model.op.ExecuteActivityMessage.executeVoid(ExecuteActivityMessage.java:45)
          at org.jbpm.pvm.internal.job.MessageImpl.execute(MessageImpl.java:46)
          at org.jbpm.pvm.internal.job.MessageImpl.execute(MessageImpl.java:32)
          at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:79)
          at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:41)
          at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
          at org.jbpm.pvm.internal.tx.SpringCommandCallback.doInTransaction(SpringCommandCallback.java:45)
          at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
          at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:49)
          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:56)
          at org.jbpm.pvm.internal.jobexecutor.JobParcel.run(JobParcel.java:48)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
          at java.util.concurrent.FutureTask.run(FutureTask.java:123)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
          at java.lang.Thread.run(Thread.java:595)
      ### EXCEPTION ###########################################
      ### EXCEPTION ###########################################
      11:17:30,093 INF       | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.ExecuteJobCmd@fa706d
      org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.pvm.internal.model.ExecutionImpl#30013]
          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.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:64)
          at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:996)
          at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1141)
          at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
          at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:835)
          at org.jbpm.pvm.internal.hibernate.DbSessionImpl.findProcessInstanceByIdIgnoreSuspended(DbSessionImpl.java:148)
          at org.jbpm.pvm.internal.hibernate.DbSessionImpl.deleteProcessInstance(DbSessionImpl.java:185)
          at org.jbpm.pvm.internal.model.ExecutionImpl.end(ExecutionImpl.java:396)
          at org.jbpm.jpdl.internal.activity.EndActivity.execute(EndActivity.java:81)
          at org.jbpm.jpdl.internal.activity.EndActivity.execute(EndActivity.java:43)
          at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
          at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:672)
          at org.jbpm.pvm.internal.model.op.ExecuteActivityMessage.executeVoid(ExecuteActivityMessage.java:45)
          at org.jbpm.pvm.internal.job.MessageImpl.execute(MessageImpl.java:46)
          at org.jbpm.pvm.internal.job.MessageImpl.execute(MessageImpl.java:32)
          at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:79)
          at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:41)
          at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
          at org.jbpm.pvm.internal.tx.SpringCommandCallback.doInTransaction(SpringCommandCallback.java:45)
          at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
          at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:49)
          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:56)
          at org.jbpm.pvm.internal.jobexecutor.JobParcel.run(JobParcel.java:48)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
          at java.util.concurrent.FutureTask.run(FutureTask.java:123)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
          at java.lang.Thread.run(Thread.java:595)
      ### EXCEPTION ###########################################
      11:17:30,125 FIN       | [JobExceptionHandler] starting new transaction for handling job exception
      11:17:30,140 FIN       | [JobExceptionHandler] handling job 30016 exception: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.pvm.internal.model.ExecutionImpl#30013]
      11:17:30,140 FIN       | [JobExceptionHandler] completed transaction for handling job exception
      11:17:30,140 FIN | [DeleteDeploymentCmd] deleting deployment 30007
      11:17:30,203 FIN       | [ExecuteJobCmd] job 30016 no longer exists
      11:17:30,250 FIN | [AsyncActivityTest] === ending testAsyncActivity =============================