ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Baldur Norddahl <bbn-iba...@inaphone.com>
Subject session leak in ibatis 2.0.8
Date Tue, 28 Dec 2004 13:55:35 GMT

I have had alot of problems with orion lockups where I would get a ton 
of messages like:

DriverManagerConnectionPoolConnection not closed, check your code!

I have finally traced it to a session leak in ibatis. The first time a 
thread makes a query, ibatis will allocate a session for that thread. 
And then never release that session again unless you explicitly call 
endTransaction(). So if you have a system that regularly creates new 
threads, you will eventually run out of sessions.

For now I have managed to work around this problem by making an 
endTransaction after every query. This simple change fixed all my lockup 
problems, and reduced the number of open database connections tremendiously.

Another application that did not have problems with lockup, went from 
using 15+ database connections to 1. I suppose this is because now the 
connections actually get put back into the pool, instead of being 
claimed indefinitly by ibatis for all my threads.


View raw message