2 Replies Latest reply on Jan 28, 2010 2:23 PM by Ali Aga

    [JBPM4] Error while ending a process having a sub-process

    Sushant Gupta Newbie

      === Environment ==============================
      - jBPM Version : jBPM4.0
      - Database : Oracle 10g
      - JDK : jdk1.5.0_16
      - Container : jdk1.5.0_16
      - Configuration : No customization done
      - Libraries : libraries that comes with jBPM

      === Process ==================================
      ============ MainProcess =========================
      <?xml version="1.0" encoding="UTF-8"?>






      <sub-process name="Subprocess1" g="117,141,92,52" sub-process-key="SubProcess">

      </sub-process>


      ============ SubProcess =========================
      <?xml version="1.0" encoding="UTF-8"?>












      === API ===================================

      String processNameWV = "MainProcess";
      String processName = processNameWV+"-1";
      String key = "MainProcess2.0";
      String executionId = processNameWV+"."+key;
      ProcessInstance processInstance = executionService.startProcessInstanceByKey(processNameWV,key );
      executionService.endProcessInstance(processInstance.getId(), "end1");



      === Stacktrace ==============================
      16:13:50,822 INF | [Environment] Hibernate 3.3.1.GA
      16:13:50,832 INF | [Environment] hibernate.properties not found
      16:13:50,832 INF | [Environment] Bytecode provider name : javassist
      16:13:50,842 INF | [Environment] using JDK 1.4 java.sql.Timestamp handling
      16:13:50,902 INF | [Configuration] configuring from resource: jbpm.hibernate.cfg.xml
      16:13:50,902 INF | [Configuration] Configuration resource: jbpm.hibernate.cfg.xml
      16:13:50,992 INF | [Configuration] Reading mappings from resource : jbpm.repository.hbm.xml
      16:13:51,253 INF | [Configuration] Reading mappings from resource : jbpm.execution.hbm.xml
      16:13:51,443 INF | [Configuration] Reading mappings from resource : jbpm.history.hbm.xml
      16:13:51,573 INF | [Configuration] Reading mappings from resource : jbpm.task.hbm.xml
      16:13:51,613 INF | [Configuration] Reading mappings from resource : jbpm.identity.hbm.xml
      16:13:51,643 INF | [Configuration] Configured SessionFactory: null
      16:13:51,673 INF | [DriverManagerConnectionProvider] Using Hibernate built-in connection pool (not for production use!)
      16:13:51,673 INF | [DriverManagerConnectionProvider] Hibernate connection pool size: 20
      16:13:51,673 INF | [DriverManagerConnectionProvider] autocommit mode: false
      16:13:51,673 INF | [DriverManagerConnectionProvider] using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@172.18.17.40:1521:etv2
      16:13:51,683 INF | [DriverManagerConnectionProvider] connection properties: {user=jbpm4, password=****}
      16:13:52,174 INF | [Dialect] Using dialect: org.hibernate.dialect.Oracle9iDialect
      16:13:52,184 INF | [TransactionFactoryFactory] Using default transaction strategy (direct JDBC transactions)
      16:13:52,184 INF | [TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
      16:13:52,194 INF | [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
      16:13:52,254 INF | [SessionFactoryImpl] building session factory
      16:13:53,296 INF | [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
      16:13:54,978 FIN | [ProcessDefinitionImpl] creating new execution for process 'MainProcess'
      16:13:55,158 FIN | [DefaultIdGenerator] generated execution id MainProcess.MainProcess2.3
      16:13:55,168 FIN | [ExecuteActivity] executing activity(start1)
      16:13:55,168 FIN | [ExecuteActivity] executing activity(Subprocess1)
      16:13:56,971 FIN | [ProcessDefinitionImpl] creating new execution for process 'SubProcess'
      16:13:57,191 FIN | [DefaultIdGenerator] generated execution id SubProcess.490
      16:13:57,201 FIN | [ExecuteActivity] executing activity(start1)
      16:13:57,201 FIN | [ExecuteActivity] executing activity(state1)
      16:13:57,372 FIN | [ExecutionImpl] execution[MainProcess.MainProcess2.3] ends with state end1
      16:13:57,452 FIN | [DbSessionImpl] deleting process instance MainProcess.MainProcess2.3
      16:13:57,502 WRN | [JDBCExceptionReporter] SQL Error: 2292, SQLState: 23000
      16:13:57,502 SEV | [JDBCExceptionReporter] ORA-02292: integrity constraint (JBPM4.FK_EXEC_SUPEREXEC) violated - child record found

      ### EXCEPTION ###########################################
      16:13:57,502 SEV | [AbstractFlushingEventListener] Could not synchronize database state with session
      org.hibernate.exception.ConstraintViolationException: could not delete: [org.jbpm.pvm.internal.model.ExecutionImpl#489]
      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:2579)
      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2735)
      at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97)
      at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172)
      at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
      at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
      at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1029)
      at org.jbpm.pvm.internal.tx.HibernateSessionResource.prepare(HibernateSessionResource.java:54)
      at org.jbpm.pvm.internal.tx.StandardTransaction.commit(StandardTransaction.java:106)
      at org.jbpm.pvm.internal.tx.StandardTransaction.complete(StandardTransaction.java:65)
      at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:61)
      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:54)
      at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
      at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.endProcessInstance(ExecutionServiceImpl.java:116)
      at TechPoC.TestJBPM4.main(TestJBPM4.java:154)
      Caused by: java.sql.SQLException: ORA-02292: integrity constraint (JBPM4.FK_EXEC_SUPEREXEC) violated - child record found

      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
      at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
      at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
      at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:966)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1170)
      at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339)
      at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3423)
      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2561)
      ... 16 more
      ### EXCEPTION ###########################################
      Exception in thread "main" org.hibernate.exception.ConstraintViolationException: could not delete: [org.jbpm.pvm.internal.model.ExecutionImpl#489]
      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:2579)
      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2735)
      at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97)
      at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172)
      at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
      at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
      at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1029)
      at org.jbpm.pvm.internal.tx.HibernateSessionResource.prepare(HibernateSessionResource.java:54)
      at org.jbpm.pvm.internal.tx.StandardTransaction.commit(StandardTransaction.java:106)
      at org.jbpm.pvm.internal.tx.StandardTransaction.complete(StandardTransaction.java:65)
      at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:61)
      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:54)
      at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
      at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.endProcessInstance(ExecutionServiceImpl.java:116)
      at TechPoC.TestJBPM4.main(TestJBPM4.java:154)
      Caused by: java.sql.SQLException: ORA-02292: integrity constraint (JBPM4.FK_EXEC_SUPEREXEC) violated - child record found

      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
      at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
      at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
      at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:966)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1170)
      at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339)
      at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3423)
      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2561)
      ... 16 more

      === Debug logs ==============================
      past debug logs here

      === Problem description =========================
      If there is an active sub process I am not able to end the main process. getting database error.