-->
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.  [ 1 post ] 
Author Message
 Post subject: explicit releaseSession after getSession
PostPosted: Wed Mar 20, 2013 7:19 pm 
Newbie

Joined: Wed Mar 20, 2013 6:06 pm
Posts: 1
I was under the impression that one has to explicitly call releaseSession() after a getSession() or am I mistaken?

I am trying to diagnose a possible connection leak in our application. We have a DAO that extends HibernateDaoSupport. Some methods use the HibernateTemplate which I know handles everything automatically, other methods have calls to getSession() but in the method there is no corresponding call to releaseSession().

The Hibernate SessionFactory is injected to the DAO through Spring, a pretty standardized configuration. There is advice that is applied to this method as well which just has a propagation="REQUIRED" and nothing else.

The Hibernate session for the application UI is established via the OpenSessionInView pattern.

The strange thing is that our connection pool gets exhausted only under some scenarios i.e. when we are running some concurrent tasks performed by non-UI worker threads, just using the UI for any amount of time does not result in an increase in # of active pool connections. We have our connection pool set to max 30 connections, the app spawns a batch of 16 worker threads, after these are done the connections are not released, the next batch of 16 worker threads exhausts the pool as only 30-16=14 connections are available...so there is a leak somewhere and I think perhaps what I found above?


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

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.