2 Replies Latest reply on Apr 27, 2007 4:53 AM by Adrian Dimulescu

    oracle deployment : constraint violation

    Adrian Dimulescu Newbie

      Hello,

      I have deployed jBPM 3.2 as an EAR under jBoss 4.0.5 with an Oracle 9 datasource.

      In order to use Oracle, I basically ran the oracle db scripts in the distribution and I changed the hibernate.dialect property in hibernate.cfg.xml from org.hibernate.dialect.HSQLDialect to org.hibernate.dialect.Oracle9Dialect.

      My problem occurs at the end of the execution of a process. I pasted the stacktrace at the end.

      A strage thing I must note is that a table called HILOSEQUENCES is created in my database on server startup even though my understanting is that the Oracle9Dialect should use a sequence and not a hilo table (the hibernate documentation states.

      About hilo id generation, the Hibernate doc (http://www.hibernate.org/hib_docs/v3/reference/en/html/mapping.html#mapping-declaration-id-hilo) states :

      Unfortunately, you can't use hilo when supplying your own Connection to Hibernate. When Hibernate is using an application server datasource to obtain connections enlisted with JTA, you must properly configure the hibernate.transaction.manager_lookup_class.


      In my case, the hibernate.transaction.manager_lookup_class is set to org.hibernate.transaction.JBossTransactionManagerLookup.

      Thanks for your ideas.

      10:44:26,738 INFO [MessageActionHandler] message: Fin!
      10:44:27,411 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,427 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,427 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,442 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,442 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,458 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,489 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,505 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,521 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,536 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,536 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,552 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,567 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,567 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,583 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,599 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,599 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,614 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,630 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,646 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,661 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,693 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,708 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,724 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,740 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,755 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,771 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,787 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,818 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,849 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,865 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,880 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,896 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,912 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,927 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,943 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,959 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,974 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:27,990 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
      10:44:28,444 INFO [STDOUT] Hibernate: insert into JBPM_TOKEN (VERSION_, NAME_, START_, END_, NODEENTER_, NEXTLOGINDEX_,
       ISABLETOREACTIVATEPARENT_, ISTERMINATIONIMPLICIT_, ISSUSPENDED_, LOCK_, NODE_, PROCESSINSTANCE_, PARENT_, SUBPROCESSINS
      TANCE_, ID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
      10:44:28,459 INFO [STDOUT] Hibernate: insert into JBPM_PROCESSINSTANCE (VERSION_, KEY_, START_, END_, ISSUSPENDED_, PRO
      CESSDEFINITION_, ROOTTOKEN_, SUPERPROCESSTOKEN_, ID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?)
      10:44:28,490 WARN [JDBCExceptionReporter] SQL Error: 1, SQLState: 23000
      10:44:28,490 ERROR [JDBCExceptionReporter] ORA-00001: violation de contrainte unique (ADRIAN.SYS_C0033755)
      
      10:44:28,506 WARN [JDBCExceptionReporter] SQL Error: 1, SQLState: 23000
      10:44:28,506 ERROR [JDBCExceptionReporter] ORA-00001: violation de contrainte unique (ADRIAN.SYS_C0033755)
      
      10:44:28,506 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
      org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
       at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)
       at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:92)
       at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:87)
       at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:218)
       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2159)
       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2595)
       at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:51)
       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:139)
       at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:29
      8)
       at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
       at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
       at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
       at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59)
       at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1491)
       at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1110)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324)
       at org.jboss.tm.TxManager.commit(TxManager.java:240)
       at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:140)
       at org.jbpm.persistence.jta.JtaDbPersistenceService.endJtaTransaction(JtaDbPersistenceService.java:67)
       at org.jbpm.persistence.jta.JtaDbPersistenceService.close(JtaDbPersistenceService.java:32)
       at org.jbpm.svc.Services.close(Services.java:222)
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
       at org.jbpm.webapp.bean.JbpmBean.closeJbpmContext(JbpmBean.java:35)
       at org.jbpm.webapp.listener.JbpmPhaseListener.afterPhase(JbpmPhaseListener.java:113)
       at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:278)
       at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jbpm.webapp.filter.LogFilter.doFilter(LogFilter.java:59)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       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.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       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:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java
      :664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.sql.BatchUpdateException: ORA-00001: violation de contrainte unique (ADRIAN.SYS_C0033755)
      
       at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343)
       at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10698)
       at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:519)
       at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
       at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
       ... 51 more
      10:44:28,725 ERROR [Services] problem closing service 'persistence'
      org.jbpm.JbpmException: couldn't commit JTA transaction
       at org.jbpm.persistence.jta.JtaDbPersistenceService.endJtaTransaction(JtaDbPersistenceService.java:69)
       at org.jbpm.persistence.jta.JtaDbPersistenceService.close(JtaDbPersistenceService.java:32)
       at org.jbpm.svc.Services.close(Services.java:222)
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
       at org.jbpm.webapp.bean.JbpmBean.closeJbpmContext(JbpmBean.java:35)
       at org.jbpm.webapp.listener.JbpmPhaseListener.afterPhase(JbpmPhaseListener.java:113)
       at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:278)
       at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jbpm.webapp.filter.LogFilter.doFilter(LogFilter.java:59)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       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.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       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:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java
      :664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=PADM
      0958/23, BranchQual=, localId=23] status=STATUS_NO_TRANSACTION; - nested throwable: (org.hibernate.exception.ConstraintV
      iolationException: Could not execute JDBC batch update)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:372)
       at org.jboss.tm.TxManager.commit(TxManager.java:240)
       at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:140)
       at org.jbpm.persistence.jta.JtaDbPersistenceService.endJtaTransaction(JtaDbPersistenceService.java:67)
       ... 31 more
      Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
       at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)
       at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:92)
       at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:87)
       at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:218)
       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2159)
       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2595)
       at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:51)
       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:139)
       at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:29
      8)
       at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
       at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
       at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
       at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59)
       at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1491)
       at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1110)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324)
       ... 34 more
      Caused by: java.sql.BatchUpdateException: ORA-00001: violation de contrainte unique (ADRIAN.SYS_C0033755)
      
       at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343)
       at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10698)
       at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:519)
       at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
       at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
       ... 51 more
      10:44:29,413 ERROR [STDERR] 26 avr. 2007 10:44:29 com.sun.faces.lifecycle.LifecycleImpl phase
      ATTENTION: phase(INVOKE_APPLICATION 5,com.sun.faces.context.FacesContextImpl@11970e2) threw exception: org.jbpm.JbpmExce
      ption: problem closing services {persistence=org.jbpm.JbpmException: couldn't commit JTA transaction} problem closing se
      rvices {persistence=org.jbpm.JbpmException: couldn't commit JTA transaction}
      org.jbpm.svc.Services.close(Services.java:234)