0 Replies Latest reply on Aug 5, 2010 3:59 AM by John Logan

    Asynchronous JBPM starting causes CONSTRAINT VIOLATION errors

    John Logan Newbie
      Hello!

      I use asynchronous JBPM starting, but unfortunatelly this causes CONSTRAINT VIOLATION errors after I get a not loggedIn exception.
      Any suggestion for this issue?

      thankx.



      7:56:13,434 WARN  [JDBCExceptionReporter] SQL Error: 1452, SQLState: 23000
      07:56:13,434 ERROR [JDBCExceptionReporter] Cannot add or update a child row: a foreign key constraint fails (`dvc`.`jbpm_moduleinstance`, CONSTRAINT

      `FK_MODINST_PRCINST` FOREIGN KEY (`PROCESSINSTANCE_`) REFERENCES `jbpm_processinstance` (`ID_`))
      07:56:13,434 ERROR [SynchronizationRegistry] Exception processing transaction Synchronization before completion
      org.hibernate.exception.ConstraintViolationException: could not insert: [org.jbpm.context.exe.ContextInstance]
           at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)
           at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
           at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64)
           at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2186)
           at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2666)
           at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
           at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
           at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321)
           at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
           at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)
           at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
           at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
           at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
           at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
           at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:534)
           at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:526)
           at org.hibernate.engine.CascadingAction$5.cascade(CascadingAction.java:241)
           at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:291)
           at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:239)
           at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:192)
           at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:319)
           at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:265)
           at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:242)
           at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:192)
           at org.hibernate.engine.Cascade.cascade(Cascade.java:153)
           at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:154)
           at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:145)
           at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:88)
           at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:49)
           at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)
           at org.jboss.seam.bpm.ManagedJbpmContext.beforeCompletion(ManagedJbpmContext.java:116)
           at org.jboss.seam.transaction.SynchronizationRegistry.beforeTransactionCompletion(SynchronizationRegistry.java:62)
           at org.jboss.seam.transaction.EjbSynchronizations.beforeCompletion(EjbSynchronizations.java:60)
           at org.jboss.ejb3.stateful.SessionSynchronizationInterceptor$SFSBSessionSynchronization.beforeCompletion(SessionSynchronizationInterceptor.java:85)
           at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:101)
           at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:269)
           at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:89)
           at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
           at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1423)
           at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:137)
           at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
           at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:162)
           at org.jboss.seam.transaction.UTTransaction.commit(UTTransaction.java:52)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:58)
           at org.jboss.seam.bpm.ProcessInstance.getProcessInstance(ProcessInstance.java:39)
           at sun.reflect.GeneratedMethodAccessor5378.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
           at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
           at org.jboss.seam.Component.unwrap(Component.java:2275)
           at org.jboss.seam.Component.getInstance(Component.java:2041)
           at org.jboss.seam.Component.getInstance(Component.java:2000)
           at org.jboss.seam.Component.getInstance(Component.java:1994)
           at org.jboss.seam.Component.getInstance(Component.java:1967)
           at org.jboss.seam.Component.getInstance(Component.java:1962)
           at org.jboss.seam.bpm.ProcessInstance.instance(ProcessInstance.java:65)
           at org.jboss.seam.bpm.BusinessProcess.hasActiveProcess(BusinessProcess.java:64)
           at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:347)
           at org.jboss.seam.contexts.Lifecycle.endCall(Lifecycle.java:101)
           at org.jboss.seam.async.Asynchronous$ContextualAsynchronousRequest.cleanup(Asynchronous.java:91)
           at org.jboss.seam.async.Asynchronous$ContextualAsynchronousRequest.run(Asynchronous.java:84)
           at org.jboss.seam.async.AsynchronousEvent.execute(AsynchronousEvent.java:27)
           at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:243)
           at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
           at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:534)
      Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails

      (`dvc`.`jbpm_moduleinstance`, CONSTRAINT `FK_MODINST_PRCINST` FOREIGN KEY (`PROCESSINSTANCE_`) REFERENCES `jbpm_processinstance` (`ID_`))
           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
           at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
           at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
           at com.mysql.jdbc.Util.getInstance(Util.java:381)
           at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
           at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
           at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3558)
           at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3490)
           at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
           at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2109)
           at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2648)
           at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2077)
           at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2362)
           at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2280)
           at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2265)
           at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:365)
           at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94)
           at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
           ... 64 more