AnsweredAssumed Answered

getVariables with ActivitiOptimisticLockingException

Question asked by mpriess on Oct 4, 2013
Latest reply on Oct 9, 2013 by trademak
HI, if I doing heavy read and write operations on a process it happen sometimes that I get this exception:

<code>
   at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:560)[141:org.activiti.engine:5.13.0]
   at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:442)[141:org.activiti.engine:5.13.0]
   at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:169)[141:org.activiti.engine:5.13.0]
   at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:116)[141:org.activiti.engine:5.13.0]
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:70)[141:org.activiti.engine:5.13.0]
   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)[144:wrap_mvn_org.activiti_activiti-spring_5.13:0]
   at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)[102:org.springframework.transaction:3.1.4.RELEASE]
   at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)[144:wrap_mvn_org.activiti_activiti-spring_5.13:0]
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)[141:org.activiti.engine:5.13.0]
   at org.activiti.engine.impl.RuntimeServiceImpl.getVariables(RuntimeServiceImpl.java:103)[141:org.activiti.engine:5.13.0]
<code>

Does anyone know why a *read* execute an database update? Is this maybe the cache which is implemented in the session? To avoid such an error I can work with synchronize for reading and writing but I think this would slow down my application. Know anyone maybe a better solution?

Regards,

Michael

Outcomes