3 Replies Latest reply on Nov 2, 2011 6:49 AM by Adam Warski

    Envers modification in Hibernate 3.6.8 is causing problems

    mikulka Newbie

      I upgraded from hibernate 3.6.5 to 3.6.8 and now an error appears. This problem seems to be caused by the solution from this issue https://hibernate.onjira.com/browse/HHH-6614. This is where the SessionCacheCleaner was created that is trying to clear cahce, but session is already closed (if I understand correctly). Is this a bug or should I somehow try to handle session closing differently than I did with hibernate 3.6.5?

       

      [AssertionFailure] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
      org.hibernate.SessionException: Session is closed!
          at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:72)
          at org.hibernate.impl.SessionImpl.fireEvict(SessionImpl.java:1164)
          at org.hibernate.impl.SessionImpl.evict(SessionImpl.java:1160)
          at org.hibernate.envers.synchronization.SessionCacheCleaner$1.doAfterTransactionCompletion(SessionCacheCleaner.java:23)
          at org.hibernate.engine.ActionQueue$AfterTransactionCompletionProcessQueue.afterTransactionCompletion(ActionQueue.java:591)
          at org.hibernate.engine.ActionQueue.afterTransactionCompletion(ActionQueue.java:210)
          at org.hibernate.impl.SessionImpl.afterTransactionCompletion(SessionImpl.java:602)
          at org.hibernate.jdbc.JDBCContext.afterTransactionCompletion(JDBCContext.java:274)
          at org.hibernate.transaction.synchronization.CallbackCoordinator.afterCompletion(CallbackCoordinator.java:146)
          at org.hibernate.transaction.synchronization.HibernateSynchronizationImpl.afterCompletion(HibernateSynchronizationImpl.java:60)
          at org.jboss.tm.TransactionImpl.doAfterCompletion(TransactionImpl.java:1526)
          at org.jboss.tm.TransactionImpl.completeTransaction(TransactionImpl.java:1198)
          at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:377)
          at org.jboss.tm.TxManager.commit(TxManager.java:240)
          at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:141)
          at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1009)
          at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
          at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724)
          at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393)
          at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
          at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)