PropertyEntity[next.dbid] was updated by another transaction

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2012 04:34 AM
We have an application that, it has 8 instance.. of course they includes theirself proccessengine.
When we run
runtimeService.startProcessInstanceByKey("ReceiveTaskTimerTest")
we get this error.
SEVERE: Error while closing command context
org.activiti.engine.ActivitiOptimisticLockingException: PropertyEntity[next.dbid] was updated by another transaction concurrently
at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:435)
at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:348)
How can we resolve this problem.?
Thank you?
- Labels:
-
Archive

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2012 04:40 AM
When call
runtimeService.startProcessInstanceByKey("ReceiveTaskTimerTest")
activiti execute this query:
select * from ACT_GE_PROPERTY where NAME_ = 'next.dbid'
if query result that: 'next.dbid',1,1
and after execute this query:
update ACT_GE_PROPERTY SET REV_ = 2, VALUE_ = (1+idBlockSize) where NAME_ = 'next.dbid' and REV_ = 1
So, when we executing the last query concurrently, we will get optimisticlockException.
As a result we want to update the first query for oracle like that:
select * from ACT_GE_PROPERTY where NAME_ = 'next.dbid' for update
is it dangerous for activiti procces engine and their components..?
thank you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2012 04:03 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2012 05:34 AM
Is it not possible to do a retry when you receive an optimistic lock exception?
I don't think the query change you propose will have any negative effects on the Activiti Engine.
Just a question out of curiosity, do you have so much users for that application that it needs 8 instances of Activiti?
Best regards,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2012 07:46 AM
Yes its possible to do a retry; but i dont want to transaction rollback.
Also i increased the proccess engine idBlockSize (act_ge_property) value from 100 to 2000, so the rollback count is increased.
Yes we need 8 instance of activiti, because we want to start 500.000 proccesses in every hour.

Is there any project like this have high count procces instance?
And if you want to see our proccess design attached it.
Thank you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2012 03:39 AM
There are some high volume examples I know of, but 500.000 per hour is the highest number I've heard of.
I think the query change would be a good option. Did you already do some tests with the query change?
Best regards,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2012 11:02 AM
Yes, we did test with this query.
We didnt get any exception. Our performans test is succesfully completed.
I think all activiti query must review for multi instance..
Thank your for reply.
Best regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2012 02:48 AM
And a retry when retrieving a block of id's and getting an OLE would indeed be an enhancement I think. Please fie a jira issue for this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2014 06:22 PM
Any solution please,
I have the similar problem:
2014-04-03 14:51:46,994 ERROR [com.x.workflow.evaluation.xxxxxxxxxxxxxxxxxTask] - An exception occurs on xxxxxxxxxxxxxxxTask: org.activiti.engine.ActivitiOptimisticLockingException: PropertyEntity[name=next.dbid, value=4345101] was updated by another transaction concurrently
at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:562)
at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:444)
at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:170)
at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:117)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:66)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
at org.activiti.engine.impl.db.DbIdGenerator.getNewBlock(DbIdGenerator.java:43)
at org.activiti.engine.impl.db.DbIdGenerator.getNextId(DbIdGenerator.java:36)
at org.activiti.engine.impl.db.DbSqlSession.insert(DbSqlSession.java:111)
at org.activiti.engine.impl.persistence.entity.VariableInstanceEntity.createAndInsert(VariableInstanceEntity.java:61)
at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.createVariableInstance(VariableScopeImpl.java:369)
at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.createVariableLocal(VariableScopeImpl.java:289)
at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.createVariableLocal(VariableScopeImpl.java:276)
at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.setVariable(VariableScopeImpl.java:256)
at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.setVariable(VariableScopeImpl.java:252)
at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.setVariable(VariableScopeImpl.java:239)
at com.x.workflow.evaluation.xxxxxxxxxxxxx.execute(xxxxxxxxxxxxxTask.java:105)
at sun.reflect.GeneratedMethodAccessor744.invoke(Unknown Source)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2014 03:53 AM
An alternative is to use the StrongUuidGenerator instead. That would prevent you from getting this error.
Best regards,
