1 Reply Latest reply on Nov 7, 2006 2:16 PM by Syed Arshad

    JBPM Process instance delete issue

    Syed Arshad Newbie

      We are getting another exception while trying to delete a process instance associated with timers:


      Hibernate: delete from JBPM_TOKENVARIABLEMAP where ID_=?
      Hibernate: delete from JBPM_MODULEINSTANCE where ID_=?
      Hibernate: delete from JBPM_PROCESSINSTANCE where ID_=? and VERSION_=?
      2006-11-01 19:34:10,422 ERROR [org.hibernate.util.JDBCExceptionReporter] - <ERROR: update or delete on "jbpm_processinstance" violates foreign key constraint "fk_timer_prinst" on "jbpm_timer">
      2006-11-01 19:34:10,422 ERROR [org.hibernate.event.def.AbstractFlushingEventListener] - <Could not synchronize database state with session>
      org.hibernate.exception.ConstraintViolationException: could not delete: [org.jbpm.graph.exe.ProcessInstance#934]
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
       at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2308)
       at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2440)
       at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:73)
       at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:144)
       at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
       at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
       at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
       at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333)
       at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
       at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:584)
       at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:496)
       at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:469)
       at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:266)
       at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
       at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
       at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
       at $Proxy6.updateAndAdjustWorkflow(Unknown Source)
       at org.donorschoose.web.control.admin.ProposalDetailController.onFormSubmit(ProposalDetailController.java:127)
       at org.donorschoose.web.control.admin.AdminBaseFormController.onSubmit(AdminBaseFormController.java:137)
       at org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:258)
       at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:259)
       at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139)
       at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
       at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:717)
       at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:658)
       at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
       at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:357)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.donorschoose.web.filter.ActionFilter.doFilter(ActionFilter.java:95)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
       at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
       at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.sql.SQLException: ERROR: update or delete on "jbpm_processinstance" violates foreign key constraint "fk_timer_prinst" on "jbpm_timer"
       at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1471)
       at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1256)
       at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175)
       at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389)
       at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:330)
       at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:282)
       at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2294)
       ... 51 more
      2006-11-01 19:34:13,456 DEBUG [org.donorschoose.web.filter.ActionFilter] - <The requested page is /dev/admin/proposal_details.html>
      Hibernate: select uridetail0_.id as id110_, uridetail0_.name as name110_, uridetail0_.urigroupId as urigroupId110_ from URI uridetail0_ where uridetail0_.name=?
      2006-11-01 19:34:13,516 DEBUG [org.donorschoose.web.filter.ActionFilter] - <The Priviliges for the requested page are: null>
      2006-11-01 19:34:13,516 DEBUG [org.donorschoose.web.control.admin.ProposalDetailController] - <<admin.AdminBaseFormController> Entered method isFormSubmission>
      2006-11-01 19:34:13,516 DEBUG [org.donorschoose.web.control.admin.ProposalDetailController] - <Displaying new form>
      2006-11-01 19:34:13,516 DEBUG [org.donorschoose.web.control.admin.ProposalDetailController] - <<formBackingObject> Method entered >



        • 1. Re: JBPM Process instance delete issue
          Syed Arshad Newbie

          ok, we did add this following two lines in GraphSession.deleteProcessInstance, which resolved the issue.

          Do you want me create a bug in JIRA and provide resolution their too?

          SchedulerService schedulerService = (SchedulerService) Services.getCurrentService(Services.SERVICENAME_SCHEDULER, false);
           if (schedulerService!=null) schedulerService.cancelTimersByProcessInstance(processInstance);