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.  [ 2 posts ] 
Author Message
 Post subject: Session leakage?
PostPosted: Fri Jun 17, 2005 2:25 pm 
Beginner
Beginner

Joined: Tue Jun 14, 2005 12:14 pm
Posts: 37
Hibernate version: 3.0.4

Database: MySQL 4.1 (Innodb)

So, I am using the "non-managed idiom":

Code:
Session sess = factory.openSession();
Transaction tx = null;
try {
    tx = sess.beginTransaction();

    // do some work
    ...

    tx.commit();
}
catch (RuntimeException e) {
    if (tx != null) tx.rollback();
    logError();
}
finally {
    sess.close();
}

with the exception that I am using the Session-per-Thread pattern. Also, the above code is invoked from an MBean on JBoss 3.2.5.

I also have the StatisticsService MBean running (great work on this bean, BTW!). I notice the following:

Sometimes, there are an extra one or two Sessions that do not get closed (i.e., SessionOpenCount > SessionCloseCount), even though session.close() gets called everytime. I notice that this also tends to happen more often with a roll-back condition than normal. Anyone noticed this before?

--Thanks,
Liem


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 17, 2005 3:47 pm 
Beginner
Beginner

Joined: Tue Jun 14, 2005 12:14 pm
Posts: 37
Never mind... Brain fart. Figure out what was wrong. Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.