AnsweredAssumed Answered

PropertyEntity[next.dbid] was updated by another transaction

Question asked by thomas1 on May 18, 2011
Latest reply on Jun 27, 2011 by madi
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

Outcomes