commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: dbcp connections leaking and not being recovered
Date Thu, 24 Apr 2003 17:34:44 GMT

On Thu, 24 Apr 2003 wrote:

> Date: Thu, 24 Apr 2003 17:20:43 +0100
> From:
> Reply-To: Jakarta Commons Users List <>
> To: Jakarta Commons Users List <>
> Subject: Re: dbcp connections leaking and not being recovered
> Yup I am trying to do this, however I cant trace where the leaks are
> coming from (and some of them are caused because I get a SQLException in
> the middle of a page and then it never runs the cleanUp stuff.
> Hmm, will just have to rewrite a load of stuff :(

That is why you should be using a "finally" block for the cleanup code.
This ensures that the cleanup is executed even if an SQLException is

I just posted a code design idiom in a previous message on this topic that
illustrates how to do this.

> Still doesnt answer however, why the DBCP does not recover abandonded
> connections after 30 seconds as I have specified in my server.xml?

Recovering abandoned connections was a bad idea in the first place, and
the DBCP code that implements it is being deprecated.  It is the
application's responsibility to avoid leaking connections.

> Pete


View raw message