Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-9073

Unique index error when correlationKey name is set to null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.36.0.Final
    • 7.35.0.Final
    • Persistence
    • None
    • 2020 Week 13-15 (from Mar 23)

      During db matrix certification this error was found. The name of the correlation Key was not correct as name should reflect the externalForm of the correlation key like the factory does.

      https://github.com/kiegroup/jbpm/blob/master/jbpm-persistence/jbpm-persistence-jpa/src/main/java/org/jbpm/persistence/correlation/JPACorrelationKeyFactory.java#L32

      10:43:45.522 [main] WARN  o.d.persistence.PersistableRunner.rollbackTransaction 410 - Could not commit session
      java.lang.RuntimeException: CorrelationKey [name=null, properties=[CorrelationPropertyInfo [name=null, value=3]]] already exists
      	at org.jbpm.persistence.JpaProcessPersistenceContext.persist(JpaProcessPersistenceContext.java:126)
      	at org.jbpm.persistence.processinstance.JPAProcessInstanceManager.addProcessInstance(JPAProcessInstanceManager.java:96)
      	at org.jbpm.process.instance.AbstractProcessInstanceFactory.createProcessInstance(AbstractProcessInstanceFactory.java:47)
      	at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:262)
      	at org.jbpm.process.instance.ProcessRuntimeImpl.createProcessInstance(ProcessRuntimeImpl.java:244)
      	at org.jbpm.process.instance.ProcessRuntimeImpl.createProcessInstance(ProcessRuntimeImpl.java:202)
      	at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:192)
      	at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:187)
      	at org.drools.core.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:1873)
      	at org.drools.core.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:122)
      	at org.drools.core.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:40)
      	at org.drools.core.fluent.impl.PseudoClockRunner.executeBatch(PseudoClockRunner.java:102)
      	at org.drools.core.fluent.impl.PseudoClockRunner.executeBatches(PseudoClockRunner.java:69)
      	at org.drools.core.fluent.impl.PseudoClockRunner.execute(PseudoClockRunner.java:61)
      	at org.drools.core.fluent.impl.PseudoClockRunner.execute(PseudoClockRunner.java:39)
      	at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39)
      	at org.drools.persistence.PersistableRunner$TransactionInterceptor.execute(PersistableRunner.java:597)
      	at org.drools.persistence.PersistableRunner$TransactionInterceptor.execute(PersistableRunner.java:563)
      	at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39)
      	at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.internalExecute(OptimisticLockRetryInterceptor.java:102)
      	at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:83)
      	at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:44)
      	at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39)
      	at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:73)
      	at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:45)
      	at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39)
      	at org.jbpm.runtime.manager.impl.error.ExecutionErrorHandlerInterceptor.internalExecute(ExecutionErrorHandlerInterceptor.java:66)
      	at org.jbpm.runtime.manager.impl.error.ExecutionErrorHandlerInterceptor.execute(ExecutionErrorHandlerInterceptor.java:52)
      	at org.jbpm.runtime.manager.impl.error.ExecutionErrorHandlerInterceptor.execute(ExecutionErrorHandlerInterceptor.java:29)
      	at org.drools.persistence.PersistableRunner.execute(PersistableRunner.java:398)
      	at org.drools.persistence.PersistableRunner.execute(PersistableRunner.java:66)
      	at org.drools.core.runtime.InternalLocalRunner.execute(InternalLocalRunner.java:37)
      	at org.drools.core.runtime.InternalLocalRunner.execute(InternalLocalRunner.java:41)
      	at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:264)
      	at org.jbpm.test.functional.async.AsyncEndSignalTest.testCorrectProcessStateAfterExceptionEndSignal(AsyncEndSignalTest.java:81)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      	at qa.tools.ikeeper.test.IKeeperJUnitConnector$1.evaluate(IKeeperJUnitConnector.java:38)
      	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
      	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
      	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
      	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
      	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
      	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
      Caused by: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
      	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
      	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
      	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
      	at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:807)
      	at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:785)
      	at org.jbpm.persistence.JpaProcessPersistenceContext.persist(JpaProcessPersistenceContext.java:119)
      	... 63 common frames omitted
      Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
      	at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:59)
      	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
      	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
      	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
      	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:178)
      	at org.hibernate.dialect.identity.GetGeneratedKeysDelegate.executeAndExtract(GetGeneratedKeysDelegate.java:57)
      	at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:42)
      	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3072)
      	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3663)
      	at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:81)
      	at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:645)
      	at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:282)
      	at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:263)
      	at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:317)
      	at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:359)
      	at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:292)
      	at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:200)
      	at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:131)
      	at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:192)
      	at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:135)
      	at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:62)
      	at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:800)
      	... 65 common frames omitted
      Caused by: com.ibm.db2.jcc.am.SqlIntegrityConstraintViolationException: DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=2;DBALLO13.CORRELATIONKEYINFO, DRIVER=4.9.78
      	at com.ibm.db2.jcc.am.fd.a(fd.java:672)
      	at com.ibm.db2.jcc.am.fd.a(fd.java:60)
      	at com.ibm.db2.jcc.am.fd.a(fd.java:127)
      	at com.ibm.db2.jcc.am.en.b(en.java:2222)
      	at com.ibm.db2.jcc.am.en.c(en.java:2205)
      	at com.ibm.db2.jcc.t4.cb.k(cb.java:355)
      	at com.ibm.db2.jcc.t4.cb.a(cb.java:61)
      	at com.ibm.db2.jcc.t4.q.a(q.java:50)
      	at com.ibm.db2.jcc.t4.sb.b(sb.java:218)
      	at com.ibm.db2.jcc.am.fn.nc(fn.java:2888)
      	at com.ibm.db2.jcc.am.fn.b(fn.java:3826)
      	at com.ibm.db2.jcc.am.fn.ec(fn.java:738)
      	at com.ibm.db2.jcc.am.fn.executeUpdate(fn.java:717)
      	at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
      	at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
      	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:175)
      

              elguardian@gmail.com Enrique González Martínez (Inactive)
              antferna Antonio Fernandez Alhambra (Inactive)
              Antonio Fernandez Alhambra Antonio Fernandez Alhambra (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: