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

Track callers of active connections for debugging

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0
    • None

    Description

      Lately we got the following exception
      org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted
      at
      org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:103)
      at
      org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)

      The reason for that was that some piece of code opened a connection, but never closed it. Tracking the active connections (and the callers of the getConnection method) would it make it easier to find such erroneous code.
      One possible approach would be to add the connection returned by BasicDataSource.getConnection together with the stacktrace in a Map holding all active connections. And removing the connection from the map during PoolableDataSource.close().

      Attachments

        Activity

          People

            Unassigned Unassigned
            arminha Armin Häberling
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: