commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pete.sto...@kisstechnologies.co.uk
Subject Re: dbcp connections leaking and not being recovered
Date Thu, 24 Apr 2003 17:57:08 GMT
Fair enough it all stems from a load of stuff we built using Dreamweaver 
MX as a small micro-app on the side of a bigger app.  I can heartily 
recommend not using dreamweaver as it is utterly rubbish in terms of 
producing its own code.  It opens a new connectiion for every resultset on 
a page and does things in an absurd way; some of it is because it has to 
support the lowest possible types of driver but still!
Anyway thx
Pete





"Craig R. McClanahan" <craigmcc@apache.org>
24/04/2003 18:34
Please respond to "Jakarta Commons Users List"
 
        To:     Jakarta Commons Users List 
<commons-user@jakarta.apache.org>
        cc: 
        Subject:        Re: dbcp connections leaking and not being 
recovered




On Thu, 24 Apr 2003 pete.storey@kisstechnologies.co.uk wrote:

> Date: Thu, 24 Apr 2003 17:20:43 +0100
> From: pete.storey@kisstechnologies.co.uk
> Reply-To: Jakarta Commons Users List <commons-user@jakarta.apache.org>
> To: Jakarta Commons Users List <commons-user@jakarta.apache.org>
> 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
thrown.

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

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message