cancel
Showing results for 
Search instead for 
Did you mean: 

ActivitiOptimisticLockingException on even the simplest process

jbrazil5
Champ in-the-making
Champ in-the-making
Activiti Version : 5.13
Database : MySQL

Hello Activiti Team!

I am still learning about Activiti so sorry if this is a dumb question…

I am trying to understand why I am receiving this exception. This only happens when I have jobExecutorActivate set to "true" in the config. Just another note, this happens in a unit test and also when I attempt to run a process normally(no unit test).

When I run any process where I have async=true on a task this exception gets thrown and the process never completes :


Exception in thread "pool-1-thread-1" org.activiti.engine.ActivitiOptimisticLockingException: JobEntity [id=55933] was updated by another transaction concurrently
   at org.activiti.engine.impl.db.DbSqlSession$CheckedDeleteOperation.execute(DbSqlSession.java:229)
   at org.activiti.engine.impl.db.DbSqlSession.flushDeletes(DbSqlSession.java:575)
   at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:443)
   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.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)


This happens even for a process with just start, script, and end task. When I take off the async=true on the script task it works fine.

I think I don't really understand what exactly the jobExecutorActivate does, and if I need it or not. I am not using any timers and in the user guide it says that jobExecutorActivate needs to be on for timers to work. Do I need it to run async processes as well? Can someone explain the basics to me?

Thank you
10 REPLIES 10

jbarrez
Star Contributor
Star Contributor
> Is there any change since 5.8, that might cause such problems?

5.8 has been released 3,5 years ago. I'd say yes Smiley Tongue

>  using AsyncExecutor will not change the outcome of the process - is that right?

No, it's a replacement for the original job executor.