commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (DBCP-390) calling invalidObject(badConnection) damage the counting of the objects in the pool.
Date Sat, 31 May 2014 04:12:02 GMT

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

Phil Steitz closed DBCP-390.
----------------------------


> calling invalidObject(badConnection) damage the counting of the objects in the pool.

> -------------------------------------------------------------------------------------
>
>                 Key: DBCP-390
>                 URL: https://issues.apache.org/jira/browse/DBCP-390
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.4
>         Environment: All env
>            Reporter: neng xu
>
> We are using DBCP pool.  The pattern of using DBCP pool is same as Apache DBCP pool example
PoolingDataSourceDataSourceExample.java. When cleaning bad connections, I noticed that it
called pool.invalidObject(object)  method to clean the bad connection object from the pool.
 Recently we found that calling invalidObject(object) could damage the number of active connections
of  the pool because this method always silently reduce the number  regardless the objects
was removed from pool or not.  For example, when the connection object is null (creating database
connection timeout happens),  calling invalidObject(badConnection) would cause the number
of Active connections to be reduce one even the method did not remove any object from pool.
This damage the counting of the object in the pool.  
> This method should only reduce the number of the objects in the pool when it successfully
removed an object from the pool.  
> Note: I understand that we may resolve the problem by checking object is null (or object
is in pool) before calling invalidObject() method. But I think it is just a first-aid solution.
 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message