Hey gang, we're getting the following error using Activiti 5.10. This seems to be happening when we try to update / insert variables in a service task, after returning from a web service call. The only real clue I have right now, that might point to the cause, is this stacktrace, and word from the development team that the web-service in question takes a LONG time to return… on the order of 3-4 minutes (I know, I know). Any thoughts on what, exactly, would be going on here?
### Error updating database. Cause: com.ibm.db2.jcc.am.SqlIntegrityConstraintViolationException: The insert or update value of the FOREIGN KEY "ACTDB01_UCB.ACT_RU_VARIABLE.ACT_FK_VAR_PROCINST" is not equal to any value of the parent key of the parent table.. SQLCODE=-530, SQLSTATE=23503, DRIVER=3.64.82
### The error may involve org.activiti.engine.impl.persistence.entity.VariableInstanceEntity.insertVariableInstance-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_RU_VARIABLE (ID_, REV_, TYPE_, NAME_, PROC_INST_ID_, EXECUTION_ID_, TASK_ID_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_) values ( ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
### Cause: com.ibm.db2.jcc.am.SqlIntegrityConstraintViolationException: The insert or update value of the FOREIGN KEY "ACTDB01_UCB.ACT_RU_VARIABLE.ACT_FK_VAR_PROCINST" is not equal to any value of the parent key of the parent table.. SQLCODE=-530, SQLSTATE=23503, DRIVER=3.64.82
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:459)
at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:369)
at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:157)
at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:109)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:49)
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:33)
at org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:46)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:736)
Caused by: com.ibm.db2.jcc.am.SqlIntegrityConstraintViolationException: The insert or update value of the FOREIGN KEY "ACTDB01_UCB.ACT_RU_VARIABLE.ACT_FK_VAR_PROCINST" is not equal to any value of the parent key of the parent table.. SQLCODE=-530, SQLSTATE=23503, DRIVER=3.64.82
at com.ibm.db2.jcc.am.bd.a(bd.java:675)
at com.ibm.db2.jcc.am.bd.a(bd.java:60)
at com.ibm.db2.jcc.am.bd.a(bd.java:127)
at com.ibm.db2.jcc.am.io.b(io.java:2371)
at com.ibm.db2.jcc.am.io.c(io.java:2354)
at com.ibm.db2.jcc.t4.ab.l(ab.java:370)
at com.ibm.db2.jcc.t4.ab.a(ab.java:62)
at com.ibm.db2.jcc.t4.p.a(p.java:50)
at com.ibm.db2.jcc.t4.rb.b(rb.java:220)
at com.ibm.db2.jcc.am.jo.mc(jo.java:3377)
at com.ibm.db2.jcc.am.jo.b(jo.java:4335)
at com.ibm.db2.jcc.am.jo.gc(jo.java:2721)
at com.ibm.db2.jcc.am.jo.execute(jo.java:2704)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.pmiExecute(WSJdbcPreparedStatement.java:938)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.execute(WSJdbcPreparedStatement.java:614)
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)
… 14 more