JBPM4.0 Oracle Parent Key Not Found Error
rams.rapol Jul 22, 2009 9:22 PMEnvironment:
JBPM4.0
Hibernate 3.3.1GA
Database: Oracle 10
When i try to create a process instance out of the following process definition, it fails with below error. The same when i run against hsql on my local it works fine. Only difference we have in oracle is the sequence are our own instead of assigned=native.
ProcessDefinition:
<?xml version="1.0" encoding="UTF-8"?> <process name="SimpleProcess" xmlns="http://jbpm.org/4.0/jpdl"> <start g="20,20,48,48"> <transition name="review1" to="review1" /> </start> <task name="review1" g="96,16,127,52"> <assignment-handler class="test.TaskHandler"> </assignment-handler> <transition name="review2" to="review2" /> </task> <task name="review2" g="96,16,127,52"> <assignment-handler class="test.TaskHandler"> </assignment-handler> <transition name="review3" to="review3" /> </task> <task name="review3" g="96,16,127,52"> <assignment-handler class="test.TaskHandler"> </assignment-handler> <transition name="endstate" to="endstate" /> </task> <end name="endstate" g="255,16,88,52" /> </process>
Error:
Caused by: java.sql.BatchUpdateException: ORA-02291: integrity constraint (JBPM4.FK_HTI_HTASK) violated - parent key not found at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343) at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10768) at com.p6spy.engine.logging.P6LogPreparedStatement.executeBatch(P6LogPreparedStatement.java:329) at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:294) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268) ... 72 more
Logs (I used p6spy driver to see values being passed)
Hibernate: select * from ( select deployment1_.OBJNAME_ as col_0_0_, deployment1_.DEPLOYMENT_ as col_1_0_ from test.JBPM4_DEPLOYMENT deployment0_, test.JBPM4_DEPLOYPROP deployment1_, test.JBPM4_DEPLOYPROP deployment2_, test.JBPM4_DEPLOYPROP deployment3_ where deployment1_.KEY_='pdid' and deployment1_.DEPLOYMENT_=deployment0_.DBID_ and deployment2_.KEY_='pdkey' and deployment2_.OBJNAME_=deployment1_.OBJNAME_ and deployment2_.DEPLOYMENT_=deployment0_.DBID_ and deployment3_.KEY_='pdversion' and deployment3_.OBJNAME_=deployment1_.OBJNAME_ and deployment3_.DEPLOYMENT_=deployment0_.DBID_ and deployment2_.STRINGVAL_='SimpleProcess' order by deployment3_.LONGVAL_ desc ) where rownum <= ? Hibernate: select * from ( select deployment0_.DBID_ as DBID1_13_, deployment0_.DEPLOYMENT_ as DEPLOYMENT2_13_, deployment0_.OBJNAME_ as OBJNAME3_13_, deployment0_.KEY_ as KEY4_13_, deployment0_.STRINGVAL_ as STRINGVAL5_13_, deployment0_.LONGVAL_ as LONGVAL6_13_ from test.JBPM4_DEPLOYPROP deployment0_ where deployment0_.KEY_='pdid' and deployment0_.STRINGVAL_='SimpleProcess-1' ) where rownum <= ? Hibernate: select test.S_JBPM4_EXECUTION.nextval from dual Hibernate: insert into test.JBPM4_EXECUTION (DBVERSION_, ACTIVITYNAME_, PROCDEFID_, HASVARS_, NAME_, KEY_, ID_, STATE_, SUSPHISTSTATE_, PRIORITY_, HISACTINST_, PARENT_, INSTANCE_, SUPEREXEC_, SUBPROCINST_, CLASS_, DBID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'pvm', ?) Hibernate: select test.S_JBPM4_HIST_PROCINST.nextval from dual Hibernate: select test.S_JBPM4_TASK.nextval from dual [2009-07-22 18:05:31,062] (TaskHandler:assignTask:24) - TaskHandler Hibernate: select historypro0_.DBID_ as DBID1_4_0_, historypro0_.DBVERSION_ as DBVERSION2_4_0_, historypro0_.ID_ as ID3_4_0_, historypro0_.PROCDEFID_ as PROCDEFID4_4_0_, historypro0_.KEY_ as KEY5_4_0_, historypro0_.START_ as START6_4_0_, historypro0_.END_ as END7_4_0_, historypro0_.DURATION_ as DURATION8_4_0_, historypro0_.STATE_ as STATE9_4_0_, historypro0_.ENDACTIVITY_ as ENDACTI10_4_0_, historypro0_.NEXTIDX_ as NEXTIDX11_4_0_ from test.JBPM4_HIST_PROCINST historypro0_ where historypro0_.DBID_=? Hibernate: select test.S_JBPM4_HIST_ACTINST.nextval from dual Hibernate: insert into test.JBPM4_HIST_PROCINST (DBVERSION_, ID_, PROCDEFID_, KEY_, START_, END_, DURATION_, STATE_, ENDACTIVITY_, NEXTIDX_, DBID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) Hibernate: insert into test.JBPM4_TASK (DBVERSION_, NAME_, DESCR_, STATE_, SUSPHISTSTATE_, ASSIGNEE_, FORM_, PRIORITY_, CREATE_, DUEDATE_, PROGRESS_, SIGNALLING_, EXECUTION_ID_, ACTIVITY_NAME_, HASVARS_, SUPERTASK_, EXECUTION_, PROCINST_, SWIMLANE_, TASKDEFNAME_, CLASS_, DBID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'T', ?) Hibernate: insert into test.JBPM4_HIST_ACTINST (DBVERSION_, HPROCI_, TYPE_, EXECUTION_, ACTIVITY_NAME_, START_, END_, DURATION_, TRANSITION_, NEXTIDX_, HTASK_, CLASS_, DBID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'task', ?)
From the above logs, its obvious that a row is being inserted into JBPM4_HIST_ACTINST instead of JBPM4_HIST_TASK, there by causing parent key not found. Tried changing hbm's a bit by adding ignore=false, etc but ain't working. Any clues?