AnsweredAssumed Answered

ActivitiOptimisticLockingException: ByteArrayEntity

Question asked by hbpost on Apr 17, 2014
Latest reply on Mar 25, 2016 by ilyagalahov
We are getting random ActivitiOptimisticLockingException's and are struggling to understand why.  We do have multiple instances of the Activiti engine running against one database, but there aren't any parallel threads going, and the error occurs on a RuntimeServiceImpl.getVariable() call, as below.  We're fairly certain that there isn't any concurrent access for the process instance either.

Caused by: org.activiti.engine.ActivitiOptimisticLockingException: ByteArrayEntity[id=142051, name=var-facts, size=6455] was updated by another transaction concurrently
        at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(
        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 org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(
        at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(
        at org.activiti.engine.impl.RuntimeServiceImpl.getVariable(

When I look at the flushUpdates call, it appears that an update is being performed.

Can someone please explain why an update to ByteArrayEntity would be occurring for a getVariable() call?


Herman Post