You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "jeho0815 (JIRA)" <ji...@apache.org> on 2016/08/25 02:22:20 UTC

[jira] [Updated] (DBCP-470) Create a new BasicDataSource, the database hasn't start, the DBCP's pool will be leaked

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

jeho0815 updated DBCP-470:
--------------------------
    Description: 
First the database hasn't start, then create a new BasicDataSource.  The method createDataSource judge dataSource == null, will create a new dataSource. The first step is create a connectionPool, second create a connectionFactory, but validateConnectionFactory will throw a SQLNestedException, the dataSource will be null again. Next itme repeat the steps again and again. The most import issue is create the connectionPool will be refered by a java.lang.Timer, so it can't be collected by GC. If the minIdle is positive, when database status is ok, it will create connection also.
As a word, the bug will cause memory leak and may cause connection leak.


  was:
First the database hasn't start, then create a new BasicDataSource.  The method createDataSource judge dataSource == null, will create a new dataSource. The first step is create a connectionPool, second create a connectionFactory, but validateConnectionFactory will throw a SQLNestedException, the dataSource will be null again. Next itme repeat the steps again and again. The most import issue is create the connectionPool will be refered by a java.lang.Timer, so it can't be collected by GC. If the minIdle is positive, when database status is ok, it will create connection also.
As a word, the bug will cause memory leak and may cause connection leak.


> Create a new BasicDataSource, the database hasn't start, the DBCP's pool will be leaked
> ---------------------------------------------------------------------------------------
>
>                 Key: DBCP-470
>                 URL: https://issues.apache.org/jira/browse/DBCP-470
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.4
>         Environment: All environment
>            Reporter: jeho0815
>              Labels: robustness, security
>             Fix For: 1.4.1
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> First the database hasn't start, then create a new BasicDataSource.  The method createDataSource judge dataSource == null, will create a new dataSource. The first step is create a connectionPool, second create a connectionFactory, but validateConnectionFactory will throw a SQLNestedException, the dataSource will be null again. Next itme repeat the steps again and again. The most import issue is create the connectionPool will be refered by a java.lang.Timer, so it can't be collected by GC. If the minIdle is positive, when database status is ok, it will create connection also.
> As a word, the bug will cause memory leak and may cause connection leak.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)