cancel
Showing results for 
Search instead for 
Did you mean: 

integrity constraint (ACT_FK_EXE_PARENT) violated - parent key not found

swamy2156
Champ on-the-rise
Champ on-the-rise
Hello Activiti Team,

Today, we faced this problem in production for the first time and not get repeating. There are 2 ASync usertasks as part of my process. When userTask1 is completed, and during userTask2 creation time, got the exception as below and hence userTask2 is not persisted in database. Surprisingly, though parent execution is still persists in database, I got this exception. Generally parent execution entity(in ACT_RU_EXECUTION) row don't hold ACT_ID_ data. But surprisingly during debug, what I observed with parent execution record consists of userTask2 taskDefId in ACT_ID_ column. Can someone throw some light to debug further.
BTW, I am using activiti version 5.17 and ORACLE database.

Log messages goes here.

15-Jun-2015[14:05:28.241]::ERROR:Smiley Tongueool-1-thread-103:Smiley Surprisedrg.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable:96 - exception during job execution:
### Error updating database. Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-02291: integrity constraint (ACT_FK_EXE_PARENT) violated - parent key not found
### The error may involve org.activiti.engine.impl.persistence.entity.ExecutionEntity.insertExecution-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_RU_EXECUTION (ID_, REV_, PROC_INST_ID_, BUSINESS_KEY_, PROC_DEF_ID_, ACT_ID_, IS_ACTIVE_, IS_CONCURRENT_, IS_SCOPE_,IS_EVENT_SCOPE_, PARENT_ID_, SUPER_EXEC_, SUSPENSION_STATE_, CACHED_ENT_STATE_, TENANT_ID_, NAME_) values ( ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
### Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-02291: integrity constraint (ACT_FK_EXE_PARENT) violated - parent key not found
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-02291: integrity constraint (ACT_FK_EXE_PARENT) violated - parent key not found
### The error may involve org.activiti.engine.impl.persistence.entity.ExecutionEntity.insertExecution-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_RU_EXECUTION (ID_, REV_, PROC_INST_ID_, BUSINESS_KEY_, PROC_DEF_ID_, ACT_ID_, IS_ACTIVE_, IS_CONCURRENT_, IS_SCOPE_,IS_EVENT_SCOPE_, PARENT_ID_, SUPER_EXEC_, SUSPENSION_STATE_, CACHED_ENT_STATE_, TENANT_ID_, NAME_) values ( ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
### Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-02291: integrity constraint (ACT_FK_EXE_PARENT) violated - parent key not found
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:761)
at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:593)
at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:211)
at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:137)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:66)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
at org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable.handleMultipleJobs(ExecuteJobsRunnable.java:94)
at org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-02291: integrity constraint (ACT_FK_EXE_PARENT) violated - parent key not found
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1044)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3584)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3685)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1376)
at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at oracle.ucp.jdbc.proxy.StatementProxyFactory.invoke(StatementProxyFactory.java:230)
at oracle.ucp.jdbc.proxy.PreparedStatementProxyFactory.invoke(PreparedStatementProxyFactory.java:124)
at com.sun.proxy.$Proxy52.execute(Unknown Source)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:41)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:66)
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:45)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:108)
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:75)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:145)
… 17 more

Thanks,
Swamy.
2 REPLIES 2

swamy2156
Champ on-the-rise
Champ on-the-rise
ACT_RU_EXECUTION table entry for parent execution as follows.(in CSV) for failed execution creation for the above.
"ID_","REV_","PROC_INST_ID_","BUSINESS_KEY_","PARENT_ID_","PROC_DEF_ID_","SUPER_EXEC_","ACT_ID_","IS_ACTIVE_","IS_CONCURRENT_","IS_SCOPE_","IS_EVENT_SCOPE_","SUSPENSION_STATE_","CACHED_ENT_STATE_","TENANT_ID_","NAME_","LOCK_TIME_"
"67c0eb05-1391-11e5-b698-020030001d11","3","67c0eb05-1391-11e5-b698-020030001d11","","","activiti_process:3:39d5e0f6-0479-11e5-aad9-020030001c46","","userTask2Def","1","0","1","0","1","0","","",""

trademak
Star Contributor
Star Contributor
Thanks for reporting the issue. But if it's not reproducible it's really hard to be able to solve this issue. If you know how to reproduce the issue or have more information about the context in which it happens we can look into it in more details.

Best regards,