[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Hibernate and JBOSS JTA failed transactions

ggreaves do-not-reply at jboss.com
Thu Sep 28 12:38:28 EDT 2006


To illustrate the code in question:

protected void closeSession() {
  |     if ( this.getSession().isOpen() ) {
  |         this.getSession().getTransaction().commit();
  |         this.getSession().close();
  |     }
  | }

When it gets into the "if", the session is open.  After the commit, the session is closed.  Thus, calling this.getSession().close() throws the "Session is already closed" exception.  Why is the commit closing the session?

BTW, this behaviour only happens on 4.0.04GA and not 4.0.03 with identical datasource / Hibernate configurations.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3974957#3974957

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3974957



More information about the jboss-user mailing list