Hi,
Is there anyone out there that faced similar problem, it happened Weblogic EJB environment, the error was thrown when you try to perform
- any hibernate transaction that query of update db
- if it happened that it failed, because of e.g. duplicate key transaction, it throws an exception, and context.setRollbackOnly() is set.
- Traced the error thrown when calling session.close(), inside the code is tryting to get conn.getSQLWarnings(), this is the point where JDBC Connection is thrown.
Is there a way for hibernate not to call getSQLWarnings()? Are there other alternatives on how I should code my ejb. Basically I just set context.setRollbackOnly() for any HibernateException
Unhandled Exception:
com.xtremax.ana.exception.AnaException:
Start server side stack trace:
com.xtremax.ana.exception.AnaException
at com.xtremax.ana.ejb.UserManagerBean.closeSession(UserManagerBean.java:250)
at com.xtremax.ana.ejb.UserManagerBean.loadUsers(UserManagerBean.java:153)
at com.xtremax.ana.ejb.UserManagerBean_ymjd1a_EOImpl.loadUsers(UserManagerBean_ymjd1a_EOImpl.java:154)
at com.xtremax.ana.ejb.UserManagerBean_ymjd1a_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:441)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:114)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:382)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:726)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:377)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)
Caused by: net.sf.hibernate.JDBCException: Cannot close connection: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.AppSetRollbackOnlyException]'. No further JDBC access is allowed within this transaction.
at net.sf.hibernate.impl.SessionFactoryImpl.closeConnection(SessionFactoryImpl.java:409)
at net.sf.hibernate.impl.SessionImpl.disconnect(SessionImpl.java:2946)
at net.sf.hibernate.impl.SessionImpl.close(SessionImpl.java:438)
at com.xtremax.util.SessionManager.closeSession(SessionManager.java:48)
at com.xtremax.ana.ejb.UserManagerBean.closeSession(UserManagerBean.java:247)
... 11 more
Caused by: java.sql.SQLException: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.AppSetRollbackOnlyException]'. No further JDBC access is allowed within this transaction.
at weblogic.jdbc.jts.Connection.checkIfRolledBack(Connection.java:590)
at weblogic.jdbc.jts.Connection.getWarnings(Connection.java:442)
at net.sf.hibernate.impl.SessionFactoryImpl.closeConnection(SessionFactoryImpl.java:404)
... 15 more
|