AnsweredAssumed Answered

JobEntity was updated by another transaction concurrently

Question asked by tomekzaremba on Feb 19, 2016
Latest reply on Nov 9, 2016 by

during stress test of our application most of process instances failed because of exception:

org.activiti.engine.ActivitiOptimisticLockingException: JobEntity [id=1301291] was updated by another transaction concurrently
   at org.activiti.engine.impl.db.DbSqlSession$CheckedDeleteOperation.execute(
   at org.activiti.engine.impl.db.DbSqlSession.flushRegularDeletes(
   at org.activiti.engine.impl.db.DbSqlSession.flushDeletes(
   at org.activiti.engine.impl.db.DbSqlSession.flush(
   at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(
   at org.activiti.engine.impl.interceptor.CommandContext.close(
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(
   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(
   at org.activiti.spring.SpringTransactionInterceptor.execute(
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(
   at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(
   at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(
   at java.util.concurrent.ThreadPoolExecutor.runWorker(
   at java.util.concurrent.ThreadPoolExecutor$

Retries counter for jobs met -1 and about 80% of started process instances freezes.
All jobs that failed are exclusive and are starting async serviceTasks.

Our architecture contains two Activiti based applications connected to same database. Both are using SpringAsyncExecutor to obtain new jobs. Most of the configuration is default for Activiti framework.

What are we doing wrong? Is Activiti not able to handle our use case to use async executor in multiple engines to process started instances?

Any help will be appreciated.