Jboss/Hibernate - Session closed issue happening randomly.

Latest response

Hi,

The below exception occurs randomly in our App server. I Hiberante generated queries printed around this exception are simple one, no huge data fetching or any complex DataBase logic involved.

Error Log:
2013-11-18 18:52:36,892 WARN [org.hibernate.jdbc.AbstractBatcher] (Thread-4795) exception clearing maxRows/queryTimeout
java.sql.SQLException: Interrupted attempting lock: org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@52ab1169
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.tryLock(BaseWrapperManagedConnection.java:272)
at org.jboss.resource.adapter.jdbc.WrappedConnection.lock(WrappedConnection.java:80)
at org.jboss.resource.adapter.jdbc.WrappedStatement.lock(WrappedStatement.java:64)
at org.jboss.resource.adapter.jdbc.WrappedStatement.getMaxRows(WrappedStatement.java:372)
at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:299)
at org.hibernate.jdbc.AbstractBatcher.closeStatements(AbstractBatcher.java:370)
at org.hibernate.jdbc.ConnectionManager.cleanup(ConnectionManager.java:405)
at org.hibernate.jdbc.ConnectionManager.close(ConnectionManager.java:347)
at org.hibernate.impl.SessionImpl.close(SessionImpl.java:327)
at org.hibernate.ejb.EntityManagerImpl.close(EntityManagerImpl.java:125)
at org.jboss.jpa.deployment.ManagedEntityManagerFactory$SessionSynchronization.afterCompletion(ManagedEntityManagerFactory.java:136)
at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.afterCompletion(SynchronizationImple.java:123)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.afterCompletion(TwoPhaseCoordinator.java:381)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(TwoPhaseCoordinator.java:116)
at com.arjuna.ats.arjuna.AtomicAction.cancel(AtomicAction.java:213)
at com.arjuna.ats.arjuna.coordinator.TransactionReaper.doCancellations(TransactionReaper.java:446)
at com.arjuna.ats.internal.arjuna.coordinator.ReaperWorkerThread.run(ReaperWorkerThread.java:91)
2013-11-18 18:52:36,892 INFO [org.hibernate.type.TimestampType] (ajp-10.151.200.74-8009-4) could not read column value from result set: CREATE2_12_; The result set is closed.
2013-11-18 18:52:36,895 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] (Thread-4795) [com.arjuna.ats.arjuna.coordinator.TransactionReaper_13] - TransactionReaper::doCancellations worker Thread[Thread-4795,5,jboss] missed interrupt when cancelling TX 7f000001:d883:525de598:31f09 -- exiting as zombie (zombie count decremented to 1)
2013-11-18 18:52:36,895 ERROR [org.jboss.aspects.tx.TxPolicy] (ajp-10.151.200.74-8009-4) javax.ejb.EJBTransactionRolledbackException: org.hibernate.SessionException: Session is closed!
2013-11-18 18:52:36,896 ERROR [org.jboss.aspects.tx.TxPolicy] (ajp-10.151.200.74-8009-4) javax.ejb.EJBTransactionRolledbackException: org.hibernate.SessionException: Session is closed!
2013-11-18 18:52:36,896 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] (ajp-10.151.200.74-8009-4) [com.arjuna.ats.arjuna.coordinator.BasicAction_40] - Abort called on already aborted atomic action 7f000001:d883:525de598:31f09
2013-11-18 18:52:37,703 INFO [org.hibernate.type.TimestampType] (ajp-10.151.200.74-8009-8) could not read column value from result set: CREATE2_12_; The result set is closed.
2013-11-18 18:52:37,703 WARN [org.hibernate.jdbc.AbstractBatcher] (Thread-4793) exception clearing maxRows/queryTimeout
java.sql.SQLException: Interrupted attempting lock: org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@67fc58ff
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.tryLock(BaseWrapperManagedConnection.java:272)
at org.jboss.resource.adapter.jdbc.WrappedConnection.lock(WrappedConnection.java:80)
at org.jboss.resource.adapter.jdbc.WrappedStatement.lock(WrappedStatement.java:64)
at org.jboss.resource.adapter.jdbc.WrappedStatement.getMaxRows(WrappedStatement.java:372)
at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:299)
at org.hibernate.jdbc.AbstractBatcher.closeStatements(AbstractBatcher.java:370)
at org.hibernate.jdbc.ConnectionManager.cleanup(ConnectionManager.java:405)
at org.hibernate.jdbc.ConnectionManager.close(ConnectionManager.java:347)
at org.hibernate.impl.SessionImpl.close(SessionImpl.java:327)
at org.hibernate.ejb.EntityManagerImpl.close(EntityManagerImpl.java:125)
at org.jboss.jpa.deployment.ManagedEntityManagerFactory$SessionSynchronization.afterCompletion(ManagedEntityManagerFactory.java:136)
at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.afterCompletion(SynchronizationImple.java:123)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.afterCompletion(TwoPhaseCoordinator.java:381)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(TwoPhaseCoordinator.java:116)
at com.arjuna.ats.arjuna.AtomicAction.cancel(AtomicAction.java:213)
at com.arjuna.ats.arjuna.coordinator.TransactionReaper.doCancellations(TransactionReaper.java:446)
at com.arjuna.ats.internal.arjuna.coordinator.ReaperWorkerThread.run(ReaperWorkerThread.java:91)
2013-11-18 18:52:37,703 WARN [org.hibernate.jdbc.AbstractBatcher] (ajp-10.151.200.74-8009-8) exception clearing maxRows/queryTimeout
java.sql.SQLException: The statement is closed.
at org.jboss.resource.adapter.jdbc.WrappedStatement.checkState(WrappedStatement.java:888)
at org.jboss.resource.adapter.jdbc.WrappedStatement.getMaxRows(WrappedStatement.java:375)
at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:299)
at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:235)

Responses

What version of JBoss EAP are you using?