[jboss-user] [JBoss jBPM] - Re: Multithreaded JobExecutor with ForEachForkActionHandler

kadlecp do-not-reply at jboss.com
Tue Jun 10 10:54:09 EDT 2008


in discussion http://www.jboss.com/index.html?module=bb&op=viewtopic&t=109636 Alex wrote
anonymous wrote : 
  | well, next problem, on a join node all incoming branches try to update the parent token, which fails
  | 

I think that that's my problem. This code in org.jbpm.graph.node.Join crashes when multiple threads are used in JobExecutor

  | LockMode lockMode = LockMode.FORCE;
  |           if (parentLockMode!=null) {
  |             lockMode = LockMode.parse(parentLockMode);
  |           }
  |           log.debug("forcing version increment on parent token "+parentToken);
  |           session.flush(); // here it sometimes crashes, receive StaleObjectStateException
  |           session.lock(parentToken, lockMode); // here it sometimes crashes, StaleObjectStateException
  | 

I tried to remove this code (I think I can see why this code is there) just to see if it's only problem. Unfortunately I received another exception related to org.hibernate.StaleObjectStateException

  | 16:27:08,826 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):
  | xe.Token#67]
  |         at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1769)
  |         at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2412)
  |         at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2312)
  |         at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2612)
  |         at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:96)
  |         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: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.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59)
  |         at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:114)
  |         at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:247)
  |         at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:86)
  |         at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
  |         at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1389)
  |         at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
  |         at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
  |         at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:140)
  |         at org.jbpm.persistence.jta.JtaDbPersistenceService.endJtaTransaction(JtaDbPersistenceService.java:91)
  |         at org.jbpm.persistence.jta.JtaDbPersistenceService.close(JtaDbPersistenceService.java:61)
  |         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)
  | 16:27:08,938 WARN  [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_2] TwoPhaseCoordinator.beforeCompletion -
  | una.ats.internal.jta.resources.arjunacore.SynchronizationImple at 1726337
  | org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect):
  | xe.Token#67]
  |         at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1769)
  |         at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2412)
  |         at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2312)
  |         at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2612)
  |         at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:96)
  |         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: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.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59)
  |         at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:114)
  |         at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:247)
  |         at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:86)
  |         at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
  |         at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1389)
  |         at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
  |         at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
  |         at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:140)
  |         at org.jbpm.persistence.jta.JtaDbPersistenceService.endJtaTransaction(JtaDbPersistenceService.java:91)
  |         at org.jbpm.persistence.jta.JtaDbPersistenceService.close(JtaDbPersistenceService.java:61)
  |         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)
  | 16:27:09,056 ERROR [Services] problem closing service 'persistence'
  | org.jbpm.JbpmException: couldn't commit JTA transaction
  |         at org.jbpm.persistence.jta.JtaDbPersistenceService.endJtaTransaction(JtaDbPersistenceService.java:93)
  |         at org.jbpm.persistence.jta.JtaDbPersistenceService.close(JtaDbPersistenceService.java:61)
  |         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)
  | Caused by: javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.a
  | ansaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state
  |         at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1401)
  |         at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
  |         at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
  |         at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:140)
  |         at org.jbpm.persistence.jta.JtaDbPersistenceService.endJtaTransaction(JtaDbPersistenceService.java:91)
  |         ... 5 more
  | Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was
  | bpm.graph.exe.Token#67]
  |         at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1769)
  |         at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2412)
  |         at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2312)
  |         at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2612)
  |         at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:96)
  |         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: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.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59)
  |         at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:114)
  |         at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:247)
  |         at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:86)
  |         at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
  |         at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1389)
  |         ... 9 more
  | 16:27:09,195 ERROR [JobExecutorThread] exception in job executor thread. waiting 5000 milliseconds
  | org.jbpm.JbpmException: couldn't commit JTA transaction
  |         at org.jbpm.persistence.jta.JtaDbPersistenceService.endJtaTransaction(JtaDbPersistenceService.java:93)
  |         at org.jbpm.persistence.jta.JtaDbPersistenceService.close(JtaDbPersistenceService.java:61)
  |         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)
  | Caused by: javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.a
  | ansaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state
  |         at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1401)
  |         at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
  |         at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
  |         at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:140)
  |         at org.jbpm.persistence.jta.JtaDbPersistenceService.endJtaTransaction(JtaDbPersistenceService.java:91)
  |         ... 5 more
  | Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was
  | bpm.graph.exe.Token#67]
  |         at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1769)
  |         at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2412)
  |         at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2312)
  |         at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2612)
  |         at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:96)
  |         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: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.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59)
  |         at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:114)
  |         at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:247)
  |         at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:86)
  |         at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
  |         at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1389)
  |         ... 9 more
  | 

Related JIRA is "concurrent process execution fails"
http://jira.jboss.com/jira/browse/JBPM-983 

I have read story about JIRA http://jira.jboss.com/jira/browse/JBPM-995, but I do not have problems with job acquirement.

Thank you for comments
Pavel

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4157051#4157051

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4157051



More information about the jboss-user mailing list