Uploaded image for project: 'Commons DBCP'
  1. Commons DBCP
  2. DBCP-470

Create a new BasicDataSource, the database hasn't start, the DBCP's pool will be leaked

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Information Provided
    • 1.4
    • 1.4.1
    • All environment

    • Important

    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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jeho0815 jeho0815
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 4h
                4h
                Remaining:
                Remaining Estimate - 4h
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified