Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
I have a scenario, where in I need to keep polling for a database column. So I am using hibernateTemplate.find("query") [Using Spring ORM support] and executing it in a loop. The query runs fine for 2-3 iterations. But during 4th iteration, it throws an error saying Transaction no longer active. Please see below for complete error stack trace
Hibernate version: 3.2
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Caused by: org.hibernate.exception.GenericJDBCException: could not inspect JDBC autocommit mode
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.JDBCContext.afterNontransactionalQuery(JDBCContext.java:228)
at org.hibernate.impl.SessionImpl.afterOperation(SessionImpl.java:437)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1134)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at com.pfizer.pgrd.like.datamanagement.dao.ArtifactDaoHibernateImpl.getNavigationPage(ArtifactDaoHibernateImpl.java:312)
at com.pfizer.pgrd.like.datamanagement.ejb.DataManagementServiceImpl.createMetaAnalysisDataFile(DataManagementServiceImpl.java:891)
at com.pfizer.pgrd.like.datamanagement.ejb.DataManagementServiceEJB.createMetaAnalysisDataFile(DataManagementServiceEJB.java:185)
at com.pfizer.pgrd.like.datamanagement.ejb.dataManagementServiceEJB_ulqz3q_EOImpl.createMetaAnalysisDataFile(dataManagementServiceEJB_ulqz3q_EOImpl.java:208)
... 44 more
Caused by: java.sql.SQLException: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 29 seconds
Name=[EJB com.pfizer.pgrd.like.datamanagement.ejb.DataManagementServiceEJB.createMetaAnalysisDataFile(java.lang.String,[B,com.pfizer.pgrd.like.datamanagement.model.Folder,java.lang.String)],Xid=BEA1-00582ABBA7517F28EDB9(33542612),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=29,seconds left=30,activeThread=Thread[ExecuteThread: '13' for queue: 'weblogic.kernel.Default',5,Thread Group for Queue: 'weblogic.kernel.Default'],XAServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(ServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(state=started,assigned=none),xar=weblogic.jdbc.wrapper.JTSXAResourceImpl@28f5ec,re-Registered = false),SCInfo[mydomain+myserver]=(state=active),properties=({weblogic.transaction.name=[EJB com.pfizer.pgrd.like.datamanagement.ejb.DataManagementServiceEJB.createMetaAnalysisDataFile(java.lang.String,[B,com.pfizer.pgrd.like.datamanagement.model.Folder,java.lang.String)], weblogic.jdbc=t3://10.76.70.81:7001}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=myserver+10.76.70.81:7001+mydomain+t3+, XAResources={},NonXAResources={})],CoordinatorURL=myserver+10.76.70.81:7001+mydomain+t3+)]'. No further JDBC access is allowed within this transaction.
at weblogic.jdbc.wrapper.JTSConnection.checkIfRolledBack(JTSConnection.java:219)
at weblogic.jdbc.wrapper.JTSConnection.checkConnection(JTSConnection.java:228)
at weblogic.jdbc.wrapper.Connection.preInvocationHandler(Connection.java:78)
at weblogic.jdbc.wrapper.JTSConnection_oracle_jdbc_driver_T4CConnection.getAutoCommit(Unknown Source)
at org.hibernate.jdbc.ConnectionManager.isAutoCommit(ConnectionManager.java:163)
at org.hibernate.jdbc.JDBCContext.afterNontransactionalQuery(JDBCContext.java:219)
... 51 more
Name and version of the database you are using: Oracle 10g
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling? Yes
Read this:
http://hibernate.org/42.html