cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with SQL: insert into ACT_RU_VARIABLE

mtvrznik
Champ in-the-making
Champ in-the-making
Hi,

we got main process with subprocess (called with CallActivity). In the subprocess is ReceivedTask where we got this error:

<blockcode>
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-02291: integritní omezení (VYZVY.ACT_FK_VAR_PROCINST) porušeno - nenalezen nadřízený klíč

### 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: java.sql.SQLIntegrityConstraintViolationException: ORA-02291: integritní omezení (VYZVY.ACT_FK_VAR_PROCINST) porušeno - nenalezen nadřízený klíč

                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:751)
                at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:586)
                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.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
                at cz.actis.activiti.ln.LNCommandInterceptor.execute(LNCommandInterceptor.java:25)
                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.TaskServiceImpl.complete(TaskServiceImpl.java:166)
                at cz.actis.activiti.commands.executions.TaskCompletedCmd.execute(TaskCompletedCmd.java:39)
                at cz.actis.activiti.commands.executions.AbstractCommandExecution.startExecution(AbstractCommandExecution.java:52)
                at cz.actis.activiti.ActivitiEngine.executeCommand(ActivitiEngine.java:152)
                at cz.actis.activiti.osgi.ActivitiEngineService.executeCommand(ActivitiEngineService.java:57)
                at cz.actis.activiti.xsp.ActivitiXSPService.executeCommand(ActivitiXSPService.java:21)
                at cz.actis.xsp.activiti.ActivitiController.executeCommand(ActivitiController.java:14)
                at sun.reflect.GeneratedMethodAccessor229.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
                at java.lang.reflect.Method.invoke(Method.java:611)
                at com.ibm.jscript.types.JavaAccessObject.call(JavaAccessObject.java:321)
                at com.ibm.jscript.types.FBSObject.call(FBSObject.java:161)
                at com.ibm.jscript.ASTTree.ASTCall.interpret(ASTCall.java:175)
                at com.ibm.jscript.ASTTree.ASTBlock.interpret(ASTBlock.java:100)
                at com.ibm.jscript.ASTTree.ASTIf.interpret(ASTIf.java:85)
                at com.ibm.jscript.ASTTree.ASTIf.interpret(ASTIf.java:85)
                at com.ibm.jscript.ASTTree.ASTProgram.interpret(ASTProgram.java:119)
                at com.ibm.jscript.ASTTree.ASTProgram.interpretEx(ASTProgram.java:139)
                at com.ibm.jscript.JSExpression._interpretExpression(JSExpression.java:435)
                at com.ibm.jscript.JSExpression.access$1(JSExpression.java:424)
                at com.ibm.jscript.JSExpression$2.run(JSExpression.java:414)
                at java.security.AccessController.doPrivileged(AccessController.java:284)
                at com.ibm.jscript.JSExpression.interpretExpression(JSExpression.java:410)
                at com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:251)
                at com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:234)
                at com.ibm.xsp.javascript.JavaScriptInterpreter.interpret(JavaScriptInterpreter.java:221)
                at com.ibm.xsp.binding.javascript.JavaScriptMethodBinding.invoke(JavaScriptMethodBinding.java:111)
                at com.ibm.xsp.actions.ExecuteScriptAction.invoke(ExecuteScriptAction.java:78)
                at com.ibm.xsp.component.UIViewRootEx.initBeforeContents(UIViewRootEx.java:1621)
                at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:333)
                at com.ibm.xsp.page.compiled.AbstractCompiledPage.createTree(AbstractCompiledPage.java:256)
                at com.ibm.xsp.page.compiled.AbstractCompiledPage.createViewRoot(AbstractCompiledPage.java:167)
                at com.ibm.xsp.application.ViewHandlerExImpl._createViewRoot(ViewHandlerExImpl.java:511)
                at com.ibm.xsp.application.ViewHandlerExImpl.createViewRoot(ViewHandlerExImpl.java:557)
                at com.ibm.xsp.application.ViewHandlerExImpl.doCreateView(ViewHandlerExImpl.java:141)
                at com.ibm.xsp.application.ViewHandlerEx.createView(ViewHandlerEx.java:90)
                at com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:238)
                at com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:204)
                at com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
                at com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:138)
                at com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
                at com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:583)
                at com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1281)
                at com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:854)
                at com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:803)
                at com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:572)
                at com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1265)
                at com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:658)
                at com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:481)
                at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:341)
                at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:297)
                at com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
Caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-02291: integritní omezení (VYZVY.ACT_FK_VAR_PROCINST) porušeno - nenalezen nadřízený klíč

                at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:1451)
                at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:1289)
                at oracle.jdbc.driver.T2CPreparedStatement.executeForDescribe(T2CPreparedStatement.java:568)
                at oracle.jdbc.driver.T2CPreparedStatement.executeForRows(T2CPreparedStatement.java:805)
                at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1709)
                at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:4364)
                at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:4587)
                at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:5691)
                at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
                at java.lang.reflect.Method.invoke(Method.java:611)
                at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:58)
                at $Proxy4.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)
                … 62 more
</blockcode>
We tried to change it to userTask or set it async, but it didn´t help.
We got this error occasionally and is hard to simulate it. It´s often when we run more task concurrently. For example we are starting new processes in cycle when user task is completed and is leading to the same receive task like a new process.

In receive task we don't set any process variables.

Do you have some tips or ideas?
6 REPLIES 6

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

Could you create jUnit test for the issue? (to see process definition).
http://forums.activiti.org/content/sticky-how-write-unit-test

Regards
Martin

mtvrznik
Champ in-the-making
Champ in-the-making
hi,

thanks for your response

we will try to prepare test, but we hope if somebody have some tips becouse we are not sure if is possible to create some kind of simple junit test for simulating this problem in our system

Michal

jbarrez
Star Contributor
Star Contributor
What does this mean?

ORA-02291: integritní omezení (VYZVY.ACT_FK_VAR_PROCINST) porušeno - nenalezen nadřízený klíč

mtvrznik
Champ in-the-making
Champ in-the-making
Oh sorry it was in czech, here is same error in english:

ORA-02291: integrity constraint (VYZVY.ACT_FK_VAR_PROCINST) violated - parent key not found

jbarrez
Star Contributor
Star Contributor
ok thanks 🙂

The error indicates that the process instance is gone. Could it be some other node in the cluster has already completed the process instance somehow?

mtvrznik
Champ in-the-making
Champ in-the-making
Thanks, this is one of the things that we looked for, but haven´t found anything wrong. We have two concurent actions when problem occured.
1. Start instance of process which is leading to user task in main process or to receive task in subprocess
2. User or agent sends process from user task from main process which leads to receive task in subprocess

We are trying to prepare simple test but we are not successful yet, maybe because in real process, there is big amount of other actions like xml and xls parsing, cooperating with IBM Notes and Oracle,… so it´s not simply possible simulate it all in jUnit test.