I am seeing "unclosed connection" messages when I rollback transactions.  
Tracing through the TransactionManager and Hibernate classes, I do not see 
Hibernate sessions being closed when rollback is called on a transaction, only 
when commit is called().

I am using HibernateContext to manage my sessions.  I begin a transaction and 
get the Hibernate session using a utility method i created that looks like this


  | 
  | public static net.sf.hibernate.Session getSession() throws 
InfrastructureException{
  | 
  |         try{
  |             TransactionManager tm = getTransactionManager();
  |             if( tm.getTransaction() == null)
  |             {
  |                 tm.begin();
  |             }
  | 
  |             Session session = 
HibernateContext.getSession("java:/HibernateFactory");
  | 
  |             return session;
  | 
  |         }catch(Exception e)
  |         {
  |             throw new InfrastructureException(e);
  |         }
  |     }
  | 
  | 

When I commit transactions, everything is fine.  However when I rollback 
transactions, I see unclosed connection statements.  I looked through the jboss 
and hibernate code, and it looks like the hibernate 
session.close() method is called from jboss' 
TransactionSynch.beforeCompletion() method which in turn is called from
TransactionImpl.doBeforeCompletion()
TransactionImpl.doBeforePrepare()
TransactionImpl.commit();

I do not see hibernate sessions being closed anywhere else in the code, which I 
assume is why I am seeing unclosed connection messages when I commit.  What am 
I missing here?

Thanks,
Emily


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

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


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to