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(
   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.engine.impl.interceptor.LogInterceptor.execute(
   at java.util.concurrent.ThreadPoolExecutor.runWorker(
   at java.util.concurrent.ThreadPoolExecutor$

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