John Aiken

Greenhorn
+ Follow
since Jul 17, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by John Aiken

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?
I have been working as a Java Developer for almost 2 years now, I do not have any certifications but plan on taking all 3 certification levels with the next year starting with the SCJP. I just wanted to get some feedback on how much more desirable you become to a potential employer when you have the SCJP?
I consider myself a good Java developer and have successfully executed many projects in lead capacity, however my portrait on paper is quite poor (i.e. lack of formal training) and I want to improve on this aspect. Wanted to know if this was the right direction? Thanks.
21 years ago
As the previous poster has said, sometimes it can be very useful to have threads in a web application perform background tasks while the client session can proceed in parallel. The negative sides to this is obviously using server resources as having a large number of threads executing may slow the server significantly enough to affect new incoming requests. Using resources this way may make sense if you are servicing a paying customer but may not make sense if its guest users.
21 years ago