Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-1393

Investigate why JpaOptLockPersistentStatefulSessionTest is failing with Hibernate 5

    XMLWordPrintable

    Details

    • Sprint:
      2018 Week 33-35
    • Story Points:
      3
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      After the upgrade of Hibernate from 4.x to 5.x, the test JpaOptLockPersistentStatefulSessionTest started to fail with org.h2.jdbc.JdbcSQLException: The object is already closed [90007-173].

      We need to investigate this failure as it might be an actual bug.

      Full stacktrace:

      13:42:54.536 [Thread-5] WARN  o.d.persistence.PersistableRunner.rollbackTransaction:391 - Could not commit session
      java.lang.RuntimeException: Unable to commit transaction
      	at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:239) ~[classes/:na]
      	at org.drools.persistence.PersistableRunner$TransactionInterceptor.execute(PersistableRunner.java:578) [classes/:na]
      	at org.drools.persistence.PersistableRunner$TransactionInterceptor.execute(PersistableRunner.java:533) [classes/:na]
      	at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39) [drools-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT]
      	at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.internalExecute(OptimisticLockRetryInterceptor.java:102) [classes/:na]
      	at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:83) [classes/:na]
      	at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:44) [classes/:na]
      	at org.drools.persistence.PersistableRunner.execute(PersistableRunner.java:379) [classes/:na]
      	at org.drools.persistence.PersistableRunner.execute(PersistableRunner.java:53) [classes/:na]
      	at org.drools.core.runtime.InternalLocalRunner.execute(InternalLocalRunner.java:37) [drools-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT]
      	at org.drools.core.runtime.InternalLocalRunner.execute(InternalLocalRunner.java:41) [drools-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT]
      	at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.setGlobal(CommandBasedStatefulKnowledgeSession.java:511) [drools-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT]
      	at org.drools.persistence.session.JpaOptLockPersistentStatefulSessionTest$InsertAndFireThread.run(JpaOptLockPersistentStatefulSessionTest.java:128) [test-classes/:na]
      Caused by: bitronix.tm.internal.BitronixRollbackException: RuntimeException thrown during beforeCompletion cycle caused transaction rollback
      	at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:241) ~[btm-2.1.4.jar:2.1.4]
      	at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:143) ~[btm-2.1.4.jar:2.1.4]
      	at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:236) ~[classes/:na]
      	... 12 common frames omitted
      Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not update: [org.drools.persistence.info.SessionInfo#1]
      	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:147) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:155) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:162) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1434) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:484) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3190) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2404) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:467) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl.beforeCompletion(JtaTransactionCoordinatorImpl.java:320) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.resource.transaction.backend.jta.internal.synchronization.SynchronizationCallbackCoordinatorNonTrackingImpl.beforeCompletion(SynchronizationCallbackCoordinatorNonTrackingImpl.java:47) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.resource.transaction.backend.jta.internal.synchronization.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:37) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at bitronix.tm.BitronixTransaction.fireBeforeCompletionEvent(BitronixTransaction.java:532) ~[btm-2.1.4.jar:2.1.4]
      	at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:235) ~[btm-2.1.4.jar:2.1.4]
      	... 14 common frames omitted
      Caused by: org.hibernate.exception.GenericJDBCException: could not update: [org.drools.persistence.info.SessionInfo#1]
      	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3215) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:3065) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3445) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:145) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:586) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:460) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:337) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1428) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	... 23 common frames omitted
      Caused by: org.h2.jdbc.JdbcSQLException: The object is already closed [90007-173]
      	at org.h2.message.DbException.getJdbcSQLException(DbException.java:331) ~[h2-1.3.173.jar:1.3.173]
      	at org.h2.message.DbException.get(DbException.java:171) ~[h2-1.3.173.jar:1.3.173]
      	at org.h2.message.DbException.get(DbException.java:148) ~[h2-1.3.173.jar:1.3.173]
      	at org.h2.message.DbException.get(DbException.java:137) ~[h2-1.3.173.jar:1.3.173]
      	at org.h2.jdbc.JdbcStatement.checkClosed(JdbcStatement.java:976) ~[h2-1.3.173.jar:1.3.173]
      	at org.h2.jdbc.JdbcPreparedStatement.checkClosed(JdbcPreparedStatement.java:1574) ~[h2-1.3.173.jar:1.3.173]
      	at org.h2.jdbc.JdbcStatement.checkClosed(JdbcStatement.java:952) ~[h2-1.3.173.jar:1.3.173]
      	at org.h2.jdbc.JdbcPreparedStatement.setParameter(JdbcPreparedStatement.java:1334) ~[h2-1.3.173.jar:1.3.173]
      	at org.h2.jdbc.JdbcPreparedStatement.setTimestamp(JdbcPreparedStatement.java:427) ~[h2-1.3.173.jar:1.3.173]
      	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) ~[na:na]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_112]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_112]
      	at bitronix.tm.resource.jdbc.BaseProxyHandlerClass.invoke(BaseProxyHandlerClass.java:64) ~[btm-2.1.4.jar:2.1.4]
      	at com.sun.proxy.$Proxy23.setTimestamp(Unknown Source) ~[na:na]
      	at org.hibernate.type.descriptor.sql.TimestampTypeDescriptor$1.doBind(TimestampTypeDescriptor.java:56) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:74) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:277) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:272) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.type.AbstractSingleColumnStandardBasicType.nullSafeSet(AbstractSingleColumnStandardBasicType.java:39) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2713) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3142) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
      	... 31 common frames omitted
      	at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:239)
      	at org.drools.persistence.PersistableRunner$TransactionInterceptor.execute(PersistableRunner.java:578)
      	at org.drools.persistence.PersistableRunner$TransactionInterceptor.execute(PersistableRunner.java:533)
      	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.persistence.PersistableRunner.execute(PersistableRunner.java:379)
      	at org.drools.persistence.PersistableRunner.execute(PersistableRunner.java:53)
      	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.setGlobal(CommandBasedStatefulKnowledgeSession.java:511)
       
      
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  swiderski.maciej Maciej Swiderski
                  Reporter:
                  psiroky Petr Široký
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: