AnsweredAssumed Answered

Handling the org.activiti.engine.ActivitiOptimisticLockingException

Question asked by arunshenbagaraj on Feb 11, 2015
Latest reply on Feb 28, 2015 by jbarrez
Hi There,

Hope u r doing good. Am using the activiti-engine version 5.17, in my workflow am using a parallel gateway with 5 service tasks running in parallel, all are exclusive jobs. Two jobs are failing with the below exception. When a service task fails, the service task starts executing from the beginning. I need to stop this, when a service task fails with the below exception, it should only try to update the db again rather than executing the service task itself again.

org.activiti.engine.ActivitiOptimisticLockingException: ProcessInstance[70004] was updated by another transaction concurrently
        at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:783)
        at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:594)
        at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:211)
        at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:137)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:66)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
        at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
        at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
        at org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable.run(ExecuteAsyncRunnable.java:73)
        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:722)

Please help me identifying the issue. Thanks in advance.

Outcomes