AnsweredAssumed Answered

ActivitiOptimisticLockingException on even the simplest process

Question asked by jbrazil5 on Dec 5, 2013
Latest reply on Jan 16, 2015 by jbarrez
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

Outcomes