[ 
https://issues.apache.org/jira/browse/DBCP-156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mark Thomas resolved DBCP-156.
------------------------------

    Resolution: Fixed

Better (very) late than never, this feature has been added to DBCP trunk for 
inclusion in DBCP 2.0 onwards.
                
> [dbcp] Specifying the maximum lifetime of a connection
> ------------------------------------------------------
>
>                 Key: DBCP-156
>                 URL: https://issues.apache.org/jira/browse/DBCP-156
>             Project: Commons Dbcp
>          Issue Type: Improvement
>    Affects Versions: 1.1
>         Environment: Operating System: All
> Platform: All
>            Reporter: Juergen Hoeller
>            Priority: Minor
>             Fix For: 2.0
>
>
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to