Commons Dbcp
  1. Commons Dbcp
  2. DBCP-391

Close on invalid connections throws unexpected exception

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.2, 1.3, 1.4
    • Fix Version/s: 1.5.1, 2.0
    • Labels:
      None

      Description

      If the underlying connection of a PoolableConnection becomes invalid due to network errors etc., it is not possible to remove it from the pool by using the close-strategy. In case of an exception I'd check if the connection is already closed (=returned to pool). If not I'd close it to return it to the pool.

      Two problems:

      • The method isClosed() returns true, even if the PoolableConnection has not the _closed state because of _conn.isClosed() returns true. The defective connection remains active, consuming connections.
      • The method close throws an SQLException ("already closed") if (and only if) the underlying connection is closed. If the PoolableConnection is in _closed state, close() returns silently (as expected)

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Markus Stier
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development