cancel
Showing results for 
Search instead for 
Did you mean: 

Errors inserting ACT_RU_IDENTITYLINK due to a MySQL constraint violation

mnorman
Champ in-the-making
Champ in-the-making
Has anyone seen the following error when claiming tasks?

<blockcode>
### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`cqms_bpm`.`ACT_RU_IDENTITYLINK`, CONSTRAINT `ACT_FK_IDL_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`))
### The error may involve org.activiti.engine.impl.persistence.entity.IdentityLinkEntity.insertIdentityLink-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_RU_IDENTITYLINK (ID_, REV_, TYPE_, USER_ID_, GROUP_ID_, TASK_ID_, PROC_INST_ID_, PROC_DEF_ID_)     values (?,             1,             ?,             ?,             ?,             ?,             ?,             ?)
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`cqms_bpm`.`ACT_RU_IDENTITYLINK`, CONSTRAINT `ACT_FK_IDL_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`))""
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`cqms_bpm`.`ACT_RU_IDENTITYLINK`, CONSTRAINT `ACT_FK_IDL_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`))
### The error may involve org.activiti.engine.impl.persistence.entity.IdentityLinkEntity.insertIdentityLink-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_RU_IDENTITYLINK (ID_, REV_, TYPE_, USER_ID_, GROUP_ID_, TASK_ID_, PROC_INST_ID_, PROC_DEF_ID_)     values (?,             1,             ?,             ?,             ?,             ?,             ?,             ?)
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`cqms_bpm`.`ACT_RU_IDENTITYLINK`, CONSTRAINT `ACT_FK_IDL_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`))
   at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23) ~[mybatis-3.1.1.jar:3.1.1]
   at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:147) ~[mybatis-3.1.1.jar:3.1.1]
   at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:134) ~[mybatis-3.1.1.jar:3.1.1]
   at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:633) ~[activiti-engine-5.12-WSM-01.jar:5.12-WSM-01]
   at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:460) ~[activiti-engine-5.12-WSM-01.jar:5.12-WSM-01]
   at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:168) ~[activiti-engine-5.12-WSM-01.jar:5.12-WSM-01]
   at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:115) ~[activiti-engine-5.12-WSM-01.jar:5.12-WSM-01]
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:70) ~[activiti-engine-5.12-WSM-01.jar:5.12-WSM-01]
   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42) ~[activiti-spring-5.12-WSM-01.jar:na]
   at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131) ~[spring-tx-3.2.2.RELEASE.jar:3.2.2.RELEASE]
   at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40) ~[activiti-spring-5.12-WSM-01.jar:na]
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31) ~[activiti-engine-5.12-WSM-01.jar:5.12-WSM-01]
   at org.activiti.engine.impl.TaskServiceImpl.claim(TaskServiceImpl.java:157) ~[activiti-engine-5.12-WSM-01.jar:5.12-WSM-01]
</blockcode>

We have seen this in production a few times recently, but it's unclear what would have changed in our code to cause this.

Any help appreciated!

– Michael
1 REPLY 1

trademak
Star Contributor
Star Contributor
This is one of the reasons why we released 5.12.1. This was one of the bugs that was present in Activiti 5.12.
Can you upgrade (basically just a JAR replace, no DB changes) and see if you still are experiencing this issue?

Best regards,