cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Unique constraint error randomly

susubhas
Champ in-the-making
Champ in-the-making
Hi,
I am getting below error randomly. Is this a known issue?

EVERE: Error while closing command context
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (SDP30D14_4.SYS_C001981724) violated

### The error may involve org.activiti.engine.impl.persistence.entity.VariableInstanceEntity.insertByteArray-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_GE_BYTEARRAY(ID_, REV_, NAME_, BYTES_, DEPLOYMENT_ID_)     values (       ?,       1,        ?,        ?,        ?     )
### Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (SDP30D14_4.SYS_C001981724) violated

                at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
                at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:147)
                at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:134)
                at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:632)
                at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:459)
                at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:167)
                at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:114)
                at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:69)
                at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
                at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
                at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
                at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
                at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:59)

14 REPLIES 14

trademak
Star Contributor
Star Contributor
Under high load it's better to use a StrongUuidGenerator like described in the user guide here:

http://www.activiti.org/userguide/#advanced.uuid.generator

Did you try that?

Best regards,

rajesh1gupta
Champ in-the-making
Champ in-the-making
HI @trademak  . I am also facing same issue with activiti 5.11 and oracle 11..is there any other solution apart from using http://www.activiti.org/userguide/#advanced.uuid.generator..

### The error may involve org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity.insertHistoricActivityInstance-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_HI_ACTINST (         ID_,         PROC_DEF_ID_,         PROC_INST_ID_,         EXECUTION_ID_,         ACT_ID_,         ACT_NAME_,         ACT_TYPE_,         ASSIGNEE_,         START_TIME_,         END_TIME_,         DURATION_       ) values (         ?,         ?,         ?,         ?,         ?,         ?,         ?,         ?,         ?,         ?,         ?       )
DuplicateKeyException: ORA-00001: unique constraint (SYS_C0034718) violated

jbarrez
Star Contributor
Star Contributor
Depends if SYS_C0034718 refers to the same problem as above?

Why would the UUID generator not be a solution?

rajesh1gupta
Champ in-the-making
Champ in-the-making
hi ,
Exception is not only on ACT_HI_ACTINST..it varies and its intermittent issue.

problem with UUID is jar dependency ..its need below jar..which is not avaialble in our nexus repository..getting this available for use is bit tedious process…can you suggest some other quick solution please

<dependency>
    <groupId>com.fasterxml.uuid</groupId>
    <artifactId>java-uuid-generator</artifactId>
    <version>3.1.3</version>
</dependency>

trademak
Star Contributor
Star Contributor
So you are saying you are unable to get this UID dependency? That's not something we can solve…..

Best regards,