Thanks for your repsonse!
>>The Hibernate session will maintain a reference to the connection it obtains from the >>Datasource until it is either closed or disconnected.
Right, I saw that the SessionImp doesn't explicitly call close on the connection, but relys on a couple of utility classes to do it. At any rate, I hacked a bit of the SessionImpl to explicitly close the connection when session.close() is called. We still run into the same problem, which is we can't keep enough connections in the pool.
>>Whether this can "leak beyond a request boundary" depends on what that filter is doing. >>Does it alwasy close the session in a finally block whose try block contains the
>>filter.doChain() call?
The answer is yes, I have overloaded the OpenSessionInViewFilter supplied by spring to explicitly close the connection. Since we rely completely on spring to manage hibernate sessions, it is hard for me to tell that we have a leak, and where it would be.
>> Understood, each request opens a session.
Certainly each concurrent request will open its own session. How else would this work?
>>The thing you need to find out is whether the pool is being depleted over a series of >>sequential requests (i.e., there really is a connection leak somewhere) or across a >>series of concurrent requests (in which case you are either opening too many >>sessions or have too small of a connection pool).
I am thinking that it is probably the latter of the two supplied problems. LIke I said earlier, since I am relying on springs openinviewsession to manage my session, a memeory leak seems to be less a possiblity. BUT, it doesn't mean it isn't possible. Is there a way to close the connection after each transaction, using the same session?
Thanks
Cardwell Cupp
|