You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Mike Bartlett (JIRA)" <ji...@apache.org> on 2010/07/08 18:43:50 UTC

[jira] Created: (DBCP-339) orphaned connectionPools created on Exception within createDataSource method

orphaned connectionPools created on Exception within createDataSource method
----------------------------------------------------------------------------

                 Key: DBCP-339
                 URL: https://issues.apache.org/jira/browse/DBCP-339
             Project: Commons Dbcp
          Issue Type: Bug
    Affects Versions: 1.4, 1.3, 1.2.2
         Environment: Linux
MySQL 5.1.47
JDK 1.6
commonsPool 1.5.4
            Reporter: Mike Bartlett


When an Exception is thrown in the BasicDataSource.createDataSource after the connectionPool instance variable has been set the connectionPool is not closed.

If the timeBetweenEvictionRunsMillis is greater than zero a TaskTimer evictor is created in the GenericObjectPool. This TaskTimer keeps running even though the DataSource was not successfully created. The evictor when it runs will attempt to create connections for this orphaned connectionPool up to the min connections (minIdle).

If the database is down when the createDataSource is called an Exception will be thrown and an orphaned connectionPool will be created. If serveral retries are attempted while the database is down several orphaned connectionPools are created. Once the database is back up, all these orphaned connectionPool's evitor threads will attempt to created minIdle connections to the database. This exhausts the max num connections on the database.

One solution to to close the connectionPool when an Exception is thrown within the createDataSource method.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DBCP-339) orphaned connectionPools created on Exception within createDataSource method

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DBCP-339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Steitz updated DBCP-339:
-----------------------------

    Fix Version/s: 1.4.1
                   1.3.1

> orphaned connectionPools created on Exception within createDataSource method
> ----------------------------------------------------------------------------
>
>                 Key: DBCP-339
>                 URL: https://issues.apache.org/jira/browse/DBCP-339
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2, 1.3, 1.4
>         Environment: Linux
> MySQL 5.1.47
> JDK 1.6
> commonsPool 1.5.4
>            Reporter: Mike Bartlett
>             Fix For: 1.3.1, 1.4.1
>
>         Attachments: DBCP-339.patch
>
>
> When an Exception is thrown in the BasicDataSource.createDataSource after the connectionPool instance variable has been set the connectionPool is not closed.
> If the timeBetweenEvictionRunsMillis is greater than zero a TaskTimer evictor is created in the GenericObjectPool. This TaskTimer keeps running even though the DataSource was not successfully created. The evictor when it runs will attempt to create connections for this orphaned connectionPool up to the min connections (minIdle).
> If the database is down when the createDataSource is called an Exception will be thrown and an orphaned connectionPool will be created. If serveral retries are attempted while the database is down several orphaned connectionPools are created. Once the database is back up, all these orphaned connectionPool's evitor threads will attempt to created minIdle connections to the database. This exhausts the max num connections on the database.
> One solution to to close the connectionPool when an Exception is thrown within the createDataSource method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DBCP-339) orphaned connectionPools created on Exception within createDataSource method

Posted by "Dmitry Semibratov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DBCP-339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dmitry Semibratov updated DBCP-339:
-----------------------------------

    Attachment: DBCP-339.patch

Proposed solution to close connection pool if  anException is thrown should work. Pool instances will be closed and associated eviction timer tasks will be canceled, and eventually garbage collected. The patch file is attached. 

> orphaned connectionPools created on Exception within createDataSource method
> ----------------------------------------------------------------------------
>
>                 Key: DBCP-339
>                 URL: https://issues.apache.org/jira/browse/DBCP-339
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2, 1.3, 1.4
>         Environment: Linux
> MySQL 5.1.47
> JDK 1.6
> commonsPool 1.5.4
>            Reporter: Mike Bartlett
>         Attachments: DBCP-339.patch
>
>
> When an Exception is thrown in the BasicDataSource.createDataSource after the connectionPool instance variable has been set the connectionPool is not closed.
> If the timeBetweenEvictionRunsMillis is greater than zero a TaskTimer evictor is created in the GenericObjectPool. This TaskTimer keeps running even though the DataSource was not successfully created. The evictor when it runs will attempt to create connections for this orphaned connectionPool up to the min connections (minIdle).
> If the database is down when the createDataSource is called an Exception will be thrown and an orphaned connectionPool will be created. If serveral retries are attempted while the database is down several orphaned connectionPools are created. Once the database is back up, all these orphaned connectionPool's evitor threads will attempt to created minIdle connections to the database. This exhausts the max num connections on the database.
> One solution to to close the connectionPool when an Exception is thrown within the createDataSource method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (DBCP-339) orphaned connectionPools created on Exception within createDataSource method

Posted by "Dmitry Semibratov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBCP-339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893828#action_12893828 ] 

Dmitry Semibratov edited comment on DBCP-339 at 7/29/10 5:22 PM:
-----------------------------------------------------------------

Proposed solution to close connection pool, if  an Exception is thrown, should work. Pool instances will be closed and associated eviction timer tasks will be canceled, and eventually garbage collected. The patch file for trunk (v 1.4.1-SNAPSHOT) is attached. 

      was (Author: dimas):
    Proposed solution to close connection pool, if  an Exception is thrown, should work. Pool instances will be closed and associated eviction timer tasks will be canceled, and eventually garbage collected. The patch file is attached. 
  
> orphaned connectionPools created on Exception within createDataSource method
> ----------------------------------------------------------------------------
>
>                 Key: DBCP-339
>                 URL: https://issues.apache.org/jira/browse/DBCP-339
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2, 1.3, 1.4
>         Environment: Linux
> MySQL 5.1.47
> JDK 1.6
> commonsPool 1.5.4
>            Reporter: Mike Bartlett
>         Attachments: DBCP-339.patch
>
>
> When an Exception is thrown in the BasicDataSource.createDataSource after the connectionPool instance variable has been set the connectionPool is not closed.
> If the timeBetweenEvictionRunsMillis is greater than zero a TaskTimer evictor is created in the GenericObjectPool. This TaskTimer keeps running even though the DataSource was not successfully created. The evictor when it runs will attempt to create connections for this orphaned connectionPool up to the min connections (minIdle).
> If the database is down when the createDataSource is called an Exception will be thrown and an orphaned connectionPool will be created. If serveral retries are attempted while the database is down several orphaned connectionPools are created. Once the database is back up, all these orphaned connectionPool's evitor threads will attempt to created minIdle connections to the database. This exhausts the max num connections on the database.
> One solution to to close the connectionPool when an Exception is thrown within the createDataSource method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (DBCP-339) orphaned connectionPools created on Exception within createDataSource method

Posted by "Dmitry Semibratov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBCP-339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893828#action_12893828 ] 

Dmitry Semibratov edited comment on DBCP-339 at 7/29/10 5:18 PM:
-----------------------------------------------------------------

Proposed solution to close connection pool, if  an Exception is thrown, should work. Pool instances will be closed and associated eviction timer tasks will be canceled, and eventually garbage collected. The patch file is attached. 

      was (Author: dimas):
    Proposed solution to close connection pool if  anException is thrown should work. Pool instances will be closed and associated eviction timer tasks will be canceled, and eventually garbage collected. The patch file is attached. 
  
> orphaned connectionPools created on Exception within createDataSource method
> ----------------------------------------------------------------------------
>
>                 Key: DBCP-339
>                 URL: https://issues.apache.org/jira/browse/DBCP-339
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2, 1.3, 1.4
>         Environment: Linux
> MySQL 5.1.47
> JDK 1.6
> commonsPool 1.5.4
>            Reporter: Mike Bartlett
>         Attachments: DBCP-339.patch
>
>
> When an Exception is thrown in the BasicDataSource.createDataSource after the connectionPool instance variable has been set the connectionPool is not closed.
> If the timeBetweenEvictionRunsMillis is greater than zero a TaskTimer evictor is created in the GenericObjectPool. This TaskTimer keeps running even though the DataSource was not successfully created. The evictor when it runs will attempt to create connections for this orphaned connectionPool up to the min connections (minIdle).
> If the database is down when the createDataSource is called an Exception will be thrown and an orphaned connectionPool will be created. If serveral retries are attempted while the database is down several orphaned connectionPools are created. Once the database is back up, all these orphaned connectionPool's evitor threads will attempt to created minIdle connections to the database. This exhausts the max num connections on the database.
> One solution to to close the connectionPool when an Exception is thrown within the createDataSource method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DBCP-339) orphaned connectionPools created on Exception within createDataSource method

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBCP-339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12887192#action_12887192 ] 

Phil Steitz commented on DBCP-339:
----------------------------------

Thank you for reporting this.  Patches welcome!

> orphaned connectionPools created on Exception within createDataSource method
> ----------------------------------------------------------------------------
>
>                 Key: DBCP-339
>                 URL: https://issues.apache.org/jira/browse/DBCP-339
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2, 1.3, 1.4
>         Environment: Linux
> MySQL 5.1.47
> JDK 1.6
> commonsPool 1.5.4
>            Reporter: Mike Bartlett
>
> When an Exception is thrown in the BasicDataSource.createDataSource after the connectionPool instance variable has been set the connectionPool is not closed.
> If the timeBetweenEvictionRunsMillis is greater than zero a TaskTimer evictor is created in the GenericObjectPool. This TaskTimer keeps running even though the DataSource was not successfully created. The evictor when it runs will attempt to create connections for this orphaned connectionPool up to the min connections (minIdle).
> If the database is down when the createDataSource is called an Exception will be thrown and an orphaned connectionPool will be created. If serveral retries are attempted while the database is down several orphaned connectionPools are created. Once the database is back up, all these orphaned connectionPool's evitor threads will attempt to created minIdle connections to the database. This exhausts the max num connections on the database.
> One solution to to close the connectionPool when an Exception is thrown within the createDataSource method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.