jBPM 4 CR1 AsyncActivity Unit Test fails due to FK constrain
joshsiaw Jun 16, 2009 7:39 AMHi, I just installed jBPM4 CR1 yesterday and have been trying out the examples and testing the api. I tried to run testAsyncActivity on JUnit and it failed with this error. Btw, I'm using MySQL 5 for the JBPM db.
19:11:49,159 FIN | [ProcessDefinitionImpl] creating new execution for process 'AsyncActivity' 19:11:49,159 FIN | [DefaultIdGenerator] generated execution id AsyncActivity.7 19:11:49,159 FIN | [ExecuteActivity] executing activity(18093512) 19:11:49,174 FIN | [JobExecutorMessageSession] sending message ExecuteActivityMessage 19:11:49,221 FIN | [ExecuteJobCmd] executing job ExecuteActivityMessage[8]... 19:11:49,237 FIN | [ExecuteActivity] executing activity(generate pdf) 19:11:49,237 FIN | [JobExecutorMessageSession] sending message ExecuteActivityMessage 19:11:49,237 FIN | [ExecuteJobCmd] executed job ExecuteActivityMessage[8] 19:11:49,284 FIN | [ExecuteJobCmd] executing job ExecuteActivityMessage[9]... 19:11:49,299 FIN | [ExecuteActivity] executing activity(calculate primes) 19:11:49,299 FIN | [ExecuteActivity] executing activity(end) 19:11:49,299 FIN | [Execution] process-instance ends with state ended 19:11:49,315 FIN | [DbSessionImpl] deleting process instance AsyncActivity.7 19:11:49,315 FIN | [ExecuteJobCmd] executed job ExecuteActivityMessage[9] 19:11:49,315 WRN | [JDBCExceptionReporter] SQL Error: 1451, SQLState: 23000 19:11:49,315 SEV | [JDBCExceptionReporter] Cannot delete or update a parent row: a foreign key constraint fails (`jbpmdb/jbpm4_execution`, CONSTRAINT `FK_EXEC_INSTANCE` FOREIGN KEY (`INSTANCE_`) REFERENCES `jbpm4_execution` (`DBID_`)) ### EXCEPTION ########################################### 19:11:49,315 SEV | [AbstractFlushingEventListener] Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: could not delete: [org.jbpm.jpdl.internal.model.JpdlExecution#7] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2569) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2725) at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97)
Basically the test is failing to delete the process instance after the jobs are done and the process reaches the end state. Does anyone have a solution for this problem? Did I setup my db connection incorrectly?
Any help would be appreciated. Thanks.