AnsweredAssumed Answered

startProcessInstanceByKey: Unique Key violation on DB

Question asked by thomas1 on May 17, 2011
Latest reply on May 20, 2011 by walterjs
Hi,

I upgraded to 5.5 and get the following exception now after running same dozen workflows:

org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: com.ibm.websphere.ce.cm.DuplicateKeyException: ORA-00001: unique constraint (SWT1CO.SYS_C0041136)

violated

### The error may involve org.activiti.engine.impl.persistence.entity.VariableInstanceEntity.insertByteArray-Inline
### The error occurred while setting parameters
### Cause: com.ibm.websphere.ce.cm.DuplicateKeyException: ORA-00001: unique constraint (SWT1CO.SYS_C0041136) violated

        at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:120)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:107)
        at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:410)
        at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:337)
        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.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:49)

This is the primary key constraint on ACT_GE_BYTEARRAY:
ALTER TABLE SWT1CO.ACT_GE_BYTEARRAY ADD (
CONSTRAINT SYS_C0041136 PRIMARY KEY ( ID_ ));

I pass a map containing five keys to startProcessInstanceByKey.

The process engine is running in an EJB on Websphere created this way:
            ProcessEngineConfiguration processEngineConfiguration = ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault();
            processEngineConfiguration.setDataSource(this.activitiDataSource);
            processEngineConfiguration.setTransactionsExternallyManaged(true);
            processEngineConfiguration.setDatabaseSchemaUpdate("false");
            processEngineConfiguration.setHistory("full");
            ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();

Could this be a problem because of parallel execution?


Thanks a lot,
Thomas

Outcomes