jugend wrote:
Yeah..It's been fixed in the new version. Made a fool of myself. :)
I have having the same problem using Weblogic8.1 and Hibernate2.1.1. I have a StatelessSessionBean using CMT and using code similar to:
public void createFoo() throws BusinessException {
...
Session session = ...get session from factory
try {
...do something like check for duplicate entities
}catch(DuplicateEntityException e) {
getSessionContext().setRollbackOnly();
throw e;
}
finally{
session.flush();
session.close();
}
}
When a duplicate entity has been detected, the DuplicateEntityException is created and thrown, but when the 'finally' clause is executed I am seeing that a SQLException is being thrown from calling the session.close() method. Listed below is the stack trace I am seeing. Any and all help would be greatly appreciated!
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
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.wrapper.JTSConnection.checkIfRolledBack(JTSConnection.java:118)
at weblogic.jdbc.wrapper.JTSConnection.checkConnection(JTSConnection.java:127)
at weblogic.jdbc.wrapper.Connection.preInvocationHandler(Connection.java:67)
at weblogic.jdbc.wrapper.JTSConnection_weblogic_jdbc_sqlserver_SQLServerConnection.getWarnings(Unknown Source)
at net.sf.hibernate.impl.BatcherImpl.closeConnection(BatcherImpl.java:267)
... 56 more