AnsweredAssumed Answered

ActivitiOptimisticLockingException when suspend ProcessInstance

Question asked by fritz128 on Sep 27, 2013
Latest reply on Oct 3, 2013 by fritz128
What I have:
I have workflow:
start = > [Main process] => [async Subprocess] => [Main Process] => end

What a problem:
When I suspend Main Process by runtimeservice.suspendProcessInstanceById, program throws exception:

Exception in thread "pool-1-thread-2" org.activiti.engine.ActivitiOptimisticLockingException: ConcurrentExecution[25] was updated by another transaction concurrently
   at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:560)
   at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:442)
   at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:169)
   at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:116)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:70)
   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
   at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131)
   at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:37)
   at org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:46)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at java.lang.Thread.run(Thread.java:724)


P.S.
At the moment when happens runtimeservice.suspendProcessInstanceById  is proceeding servicetask of the subprocess.

Outcomes