You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/04/05 17:53:22 UTC
DO NOT REPLY [Bug 28211] New: -
Specifying the maximum lifetime of a connection
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28211>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=28211
Specifying the maximum lifetime of a connection
Summary: Specifying the maximum lifetime of a connection
Product: Commons
Version: 1.1 Final
Platform: All
URL: http://www.springframework.org
OS/Version: All
Status: NEW
Severity: Enhancement
Priority: Other
Component: Dbcp
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: juergen.hoeller@werk3at.com
It would be excellent if BasicDataSource had a "maxLifetime" property, for
specifying the maximum lifetime of a connection in the pool, no matter how long
it's been active or idle, and no matter whether it still seems to be alive.
Commons DBCP does not support this yet; it just offers various connection
validation means, which is not the same.
This is particularly relevant for MySQL Connector/J 3.0.x which tries to apply
some weird automatic recovery when a MySQL connection has timed out, resulting
in all sorts of issues. The best way to deal with this is to set the maximum
lifetime of a connection to 4 hours or the like: If it's older, simply kill it,
even if it's still alive at that point of time.
Note that Proxool (http://proxool.sourceforge.net) does have such a property,
namely "maximum-connection-lifetime". Resin's connection pool has a similar
property named "max-pool-time" (http://www.caucho.com/resin-2.1/ref/db-
config.xtp). I tend to prefer Commons DBCP, but the lack of such a property
forces me to look for alternative pools.
Juergen
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org