-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: The transaction is no longer active 'Marked rollback'
PostPosted: Mon Dec 15, 2003 11:26 pm 
Newbie

Joined: Wed Nov 12, 2003 7:20 am
Posts: 6
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()? Or if there are other alternatives on how I should code my ejb.

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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 15, 2003 11:39 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
eh? what version of Hibernate is this?? Something ancient?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2004 9:50 am 
Newbie

Joined: Wed Nov 12, 2003 7:20 am
Posts: 6
Yeah..It's been fixed in the new version. Made a fool of myself. :)


Top
 Profile  
 
 Post subject: Having a similar problem with Weblogic8.1 and Hibernate2.1.1
PostPosted: Wed Jan 28, 2004 9:03 pm 
Newbie

Joined: Sat Aug 30, 2003 5:55 pm
Posts: 7
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


Top
 Profile  
 
 Post subject: Marked Rollback
PostPosted: Wed Jan 28, 2004 10:16 pm 
Newbie

Joined: Wed Nov 12, 2003 7:20 am
Posts: 6
Hi there,

You shouldn't put session.flush() in the finally think that this method doesn't check if the connection has been closed.

try {

session.flush();
} catch (Exception e) {
// set rollback
} finally {
if (session != null) session.close();
}


Top
 Profile  
 
 Post subject: Re: Marked Rollback
PostPosted: Thu Jan 29, 2004 12:15 am 
Newbie

Joined: Sat Aug 30, 2003 5:55 pm
Posts: 7
jugend wrote:
Hi there,

You shouldn't put session.flush() in the finally think that this method doesn't check if the connection has been closed.

try {

session.flush();
} catch (Exception e) {
// set rollback
} finally {
if (session != null) session.close();
}



Thanks for the reply. I changed the code to only call the session.close() in the 'finally' block, but I still get the same exceptions thrown. I'm wondering if this is really a Weblogic8.1 configuration issue because Hibernate is simply calling the connection.getWarnings() method which is throwing the exception? Is anyone using Weblogic8.1 and seeing similar problems?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 12:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Yes, WebLogic is being a real prima donna and throwing exceptions from a harmless call to getWarnings(). We have patched this problem in current CVS.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.