cancel
Showing results for 
Search instead for 
Did you mean: 

getVariables with ActivitiOptimisticLockingException

mpriess
Champ in-the-making
Champ in-the-making
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)[141Smiley Surprisedrg.activiti.engine:5.13.0]
   at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:442)[141Smiley Surprisedrg.activiti.engine:5.13.0]
   at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:169)[141Smiley Surprisedrg.activiti.engine:5.13.0]
   at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:116)[141Smiley Surprisedrg.activiti.engine:5.13.0]
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:70)[141Smiley Surprisedrg.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)[102Smiley Surprisedrg.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)[141Smiley Surprisedrg.activiti.engine:5.13.0]
   at org.activiti.engine.impl.RuntimeServiceImpl.getVariables(RuntimeServiceImpl.java:103)[141Smiley Surprisedrg.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
2 REPLIES 2

mpriess
Champ in-the-making
Champ in-the-making
btw. actually I'm using Activiti 5.13 and why can I not edit my post?

trademak
Star Contributor
Star Contributor
Hi,

A little bit of code would help. Can you reproduce this in a unit test?
Hmm strange, that you can't edit the post. I'll see if I can change that setting in the forum administration.

Best regards,