commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: [PATCH] DBCP, tracking, reporting, and recovering abandoned connections
Date Thu, 16 May 2002 19:06:42 GMT
Based on the vote, Glenn now has karma on jakarta-commons and can
commit this directly ... welcome!

Craig


On Wed, 15 May 2002, Glenn Nielsen wrote:

> Date: Wed, 15 May 2002 09:35:13 -0500
> From: Glenn Nielsen <glenn@voyager.apg.more.net>
> Reply-To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>
> To: commons-dev@jakarta.apache.org
> Subject: [PATCH] DBCP, tracking, reporting,
>      and recovering abandoned connections
>
> I have expanded upon the work James House did to generate stack
> traces for abandoned db connections. (Thanks James)
>
> The patch he provided was refactored and some new features added.
>
> Three new DBCP parameters were added:
>
> removeAbandoned - True or false. If true abandoned db connections
> are removed after the removeAbandonedTimout is exceeded if the dbcp
> is nearing exhaustion.
>
> removeAbandonedTimeout - Time in seconds since a connection was last
> used before it is considered abandoned.
>
> logAbandoned - True or false.  If true Exception stack traces are
> created so that the source of an abandoned db connection can be logged.
>
> While reviewing the code I noticed that Statements and ResultSets were
> not being closed when a Connection was closed (recycled).  This behaviour
> differs from the JDBC spec which states that the underlying Statements
> and ResultSets should be closed when a Connection is closed.  This
> patch tracks Statements and ResultSets so that when the Connection
> which created them is closed they are closed also.
>
> This patch should be backward compatible with any code which uses
> the existing DBCP.
>
> I also have a patch to the Tomcat 4 DbcpDataSourceFactory.java so
> that it can use these new features.
>
> I have been running Tomcat 4.1 with this new DBCP code on a production
> system with 10-20k DBCP uses per day for the last three days and it
> has worked well.
>
> For me, this patch is critical for a production system. It ensures
> that Tomcat and the DBCP can recover from buggy applications which
> sometimes fail to return a db connection to the pool.  In addition
> it can point the finger at the buggy application which failed to
> return a connection to the pool.
>
> I can post the patch to the list, or if someone wants to grant me
> karma for jakarta-commons I can just commit it to CVS.
>
> Regards,
>
> Glenn
>
> ----------------------------------------------------------------------
> Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
> MOREnet System Programming               |  * if iz ina coment.      |
> Missouri Research and Education Network  |  */                       |
> ----------------------------------------------------------------------
>
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message