3 Replies Latest reply on Mar 1, 2012 2:01 AM by Arun V G

    java.sql.BatchUpdateException: ORA-00001: unique constraint (DB007.SYS_C0044325) violated

    Mahi M Newbie

      Hi JBPM Community,

       

       

      While launching a new Process we are receiving Unique Constraint Violation Exception Intermittenly.

       

      Copied  the same for the reference

       

      Caused by: java.sql.BatchUpdateException: ORA-00001:

      unique constraint (DB007.SYS_C0044325) violated

      javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException:

      Could not execute JDBC batch update

      at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)

      at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:513)

      at bitronix.tm.BitronixTransaction.fireBeforeCompletionEvent(BitronixTransaction.java:478)

       

       

       

      Please do reply to get out of this exception.

       

      Thanks

        • 1. Re: java.sql.BatchUpdateException: ORA-00001: unique constraint (DB007.SYS_C0044325) violated
          Prashanth Karnam Newbie

          Check the logs for jBPM hibernate queries being executed after starting a process , this is mainly because one of the parameters in the query is null or the user in the first task is not available in the organizationalentity table.

           

          regards

          Prashanth Karnam

          • 2. Re: java.sql.BatchUpdateException: ORA-00001: unique constraint (DB007.SYS_C0044325) violated
            Mahi M Newbie

            Hi Prashanth thanks for the reply, I confirmed your reply on this exception.

             

            Actually I am getting this exception randomly. I mean 1 in 10 times.

            I can able to launch the process successfully 9 times but one time I am getting this constaraint violation exception.

             

            Detailed Log for your reference,

             

            Please so reply as i am forced to mark it as a high threat as it is happening aperiodically.

             

             

             

             

            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:253)

             

                at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)

             

                at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)

             

                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.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)

             

                at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:504)

             

                at bitronix.tm.BitronixTransaction.fireBeforeCompletionEvent(BitronixTransaction.java:478)

             

                at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:193)

             

                at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:120)

             

                at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:179)

             

                at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:348)

             

                at org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.completeWorkItem(CommandBasedStatefulKnowledgeSession.java:150)

             

                at org.quartz.core.JobRunShell.run(JobRunShell.java:202)

             

                at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)

             

            Caused by: java.sql.BatchUpdateException: ORA-00001: unique constraint (DM154.SYS_C0044325) violated

             

             

                at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:498)

             

                at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:12432)

             

                at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)

             

                at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)

             

                at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)

             

                at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)

             

                ... 17 more

             

            Feb 23, 2012 6:42:21 PM org.drools.persistence.jta.JtaTransactionManager commit

             

            WARNING: Unable to commit transaction

             

            javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update

             

                at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)

             

                at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:513)

             

                at bitronix.tm.BitronixTransaction.fireBeforeCompletionEvent(BitronixTransaction.java:478)

             

                at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:193)

             

                at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:120)

             

                at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:179)

             

                at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:348)

             

                at org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.completeWorkItem(CommandBasedStatefulKnowledgeSession.java:150)

             

             

                at org.quartz.core.JobRunShell.run(JobRunShell.java:202)

             

                at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)

             

            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:253)

             

                at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)

             

                at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)

             

                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.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)

             

                at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:504)

             

                ... 10 more

             

            Caused by: java.sql.BatchUpdateException: ORA-00001: unique constraint (DM154.SYS_C0044325) violated

             

             

             

                at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:498)

             

                at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:12432)

             

                at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)

             

                at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)

             

                at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)

             

                at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)

             

                ... 17 more

             

            Feb 23, 2012 6:42:21 PM org.drools.persistence.SingleSessionCommandService rollbackTransaction

             

            SEVERE: Could not commit session

             

            java.lang.RuntimeException: Unable to commit transaction

             

                at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:182)

             

                at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:348)

             

                at org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.completeWorkItem(CommandBasedStatefulKnowledgeSession.java:150)

              

                at org.quartz.core.JobRunShell.run(JobRunShell.java:202)

             

                at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)

             

            Caused by: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update

             

                at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)

             

                at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:513)

             

                at bitronix.tm.BitronixTransaction.fireBeforeCompletionEvent(BitronixTransaction.java:478)

             

                at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:193)

             

                at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:120)

             

                at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:179)

             

                ... 6 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:253)

             

                at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)

             

                at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)

             

                at org.hiber

             

             

             

             

             

            Thanks

            • 3. Re: java.sql.BatchUpdateException: ORA-00001: unique constraint (DB007.SYS_C0044325) violated
              Arun V G Newbie

              Please check the detail of the constraint DB007.SYS_C0044325  in your RDBMS.

               

              Initially during the evaluation I was getting a similar  issue due to the settings of hibernate.hbm2ddl.auto in the persistence.xml

               

              For me the issue was with the organizationalentity table .

               

              Hope this hint helps

               

              Cheers