tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton Tagunov <>
Subject Re[2]: Datasource connections not released when reloading context
Date Sun, 05 Oct 2003 06:51:43 GMT
Hello Jose!

Friday, October 3, 2003, 2:30:12 AM, you wrote:

JAM> On Wed, Oct 01, 2003 at 11:37:39AM -0500, Matt Raible wrote:
>> I already do this, but when I "reload" my context, I get two database
>> connections, rather than one.  So each time I reload, I get an additional
>> connection - eventually resulting in an OutOfMemory Error (which I'm
>> attributing to this) after I reload 10-20 times.

JAM> That is what I was talking about. I have that problem. I close connections after each
access but when I reload my context I guess a new datasource is created, therefore oppening
new connections.
JAM> After many reloads the database max limit of connections is reached...

JAM> Does any one have an idea of what may be going on???
JAM> May be it could be that I do not nullify the datasource in some destroy() method but
I am not sure...

Don't think there's a good solution for this for now.
This surely is not this removeAbondoned feature - it's buggy
and deprecated.

Probably in production we should avoid reloading contexts
at all.

Anyways this wastes tons of memory - so your OutOfMemory
is most likely not due to DBCP but to the general overhead
of reloading contexts.

Use reloading on development boxes only and beware that you
loose lots of memory. Do not do that on production boxes.

As for DBCP then there is no good way for now with JNDI.
The only way around currently known is to instantiate
and destroy the pool yourself, in you ContextListener-s
and binding them to the context. But again, it looks
like you're loosing memory not via DBCP at least this
is not the largest memory sucker in case of reloading


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message