cancel
Showing results for 
Search instead for 
Did you mean: 

PropertyEntity[next.dbid] was updated by another transaction

thomas1
Champ in-the-making
Champ in-the-making
Hi,

I use Activiti 5.5 in an EJB with Container Managed Persistence.

The ProcessEngine is created this way:

            ProcessEngineConfiguration processEngineConfiguration = ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault();
            processEngineConfiguration.setDataSource(this.activitiDataSource);
            processEngineConfiguration.setTransactionsExternallyManaged(true);
            processEngineConfiguration.setDatabaseSchemaUpdate("false");
            processEngineConfiguration.setHistory("full");
            ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();

When running 20 EJBs in parallel about 5% of all workflow calls fail with the following exception:
PropertyEntity[next.dbid] was updated by another transaction concurrently
org.activiti.engine.ActivitiOptimisticLockingException: PropertyEntity[next.dbid] was updated by another transaction concurrently
        at java.lang.Throwable.<init>(Throwable.java:67)
        at org.activiti.engine.ActivitiException.<init>(ActivitiException.java:30)
        at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:416)
        at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:338)
        at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:147)
        at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:103)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:49)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
        at org.activiti.engine.impl.db.DbIdGenerator.getNewBlock(DbIdGenerator.java:41)
        at org.activiti.engine.impl.db.DbIdGenerator.getNextId(DbIdGenerator.java:34)

This dbid in table ACT_GE_PROPERTY seems to be a sequence number? Is it possible to switch to a database sequence instead?


Thanks,
Thomas
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
Are those EJB's updating the same execution or process-instance?

thomas1
Champ in-the-making
Champ in-the-making
No, each EJB has its own process-instance and execution but all access the same database.

madi
Champ in-the-making
Champ in-the-making
Hi,

I have exactly the same issue, with OptimisticLockingException being thrown. I found the following open ticket on Activiti Issues page: http://jira.codehaus.org/browse/ACT-789 , which should fix the problem.

Do you know if there is any confirmation that the fix will really be included in 5.7?

Thanks!