1 Reply Latest reply on Aug 27, 2010 1:16 AM by Alejandro Guizar

    Help me! processinstance why not delete?

    chen lei Newbie

      my project use JBPM 3.2.1. Now ,customer business Data is very so many. I use JBPM API (deleteProcessInstance) delete data.but console out Error.Error is deplay:

      org.jbpm.JbpmException: problem closing services {persistence=org.jbpm.persistence.JbpmPersistenceException: hibernate flush failed}
      at org.jbpm.svc.Services.close(Services.java:234)
      at org.jbpm.JbpmContext.close(JbpmContext.java:139)
      at com.wedge.edp.framework.jbpm.dao.support.JbpmTemplate.closeJbpmContext(JbpmTemplate.java:109)
      at com.wedge.edp.framework.jbpm.dao.support.JbpmTemplate.execute(JbpmTemplate.java:84)
      at com.wedge.edp.framework.jbpm.service.support.OpenWorkflowContextAdvice.invoke(OpenWorkflowContextAdvice.java:22)
      at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:576)
      at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:562)
      at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:60)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
      at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
      at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:630)
      at com.wedge.edp.framework.jbpm.application.JbpmProcessApplication$$EnhancerByCGLIB$$22de81b1.deleteProcess(<generated>)
      at com.wedge.rms.commons.process.service.impl.ProcessServiceImpl.proceeDelete(ProcessServiceImpl.java:345)
      at com.wedge.rms.commons.process.service.impl.ProcessServiceImpl$$FastClassByCGLIB$$e6553eb9.invoke(<generated>)
      at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
      at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:695)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
      at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:630)
      at com.wedge.rms.commons.process.service.impl.ProcessServiceImpl$$EnhancerByCGLIB$$95e4e6ee.proceeDelete(<generated>)
      at test.wfTest.delete(wfTest.java:51)
      at test.wfTest.main(wfTest.java:46)
      Caused by: org.jbpm.persistence.JbpmPersistenceException: hibernate flush failed
      at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:236)
      at org.jbpm.svc.Services.close(Services.java:222)
      ... 28 more
      Caused by: org.hibernate.exception.ConstraintViolationException: could not delete: [org.jbpm.graph.exe.ProcessInstance#6094]
      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:2491)
      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2647)
      at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:74)
      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:298)
      at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
      at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
      at org.jbpm.persistence.db.DbPersistenceService.flushSession(DbPersistenceService.java:267)
      at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:231)
      ... 29 more
      Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: DELETE 语句与 REFERENCE 约束"FK_TOKEN_SUBPI"冲突。该冲突发生于数据库"PES",表"dbo.JBPM_TOKEN", column 'SUBPROCESSINSTANCE_'。
      at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
      at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
      at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source)
      at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(Unknown Source)
      at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
      at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
      at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source)
      at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)
      at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(Unknown Source)
      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2473)
      ... 39 more

       

      see database.JBPM_PROCESSINSTANCE and JBPM_TOKEN.Table.subprocessinstance_ is null.

      why I can't delete it?  how should I delete?