Commons Dbcp
  1. Commons Dbcp
  2. DBCP-322

CPDSConnectionFactory.validateObject(Object) ignores Throwable

    Details

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

      Description

      CPDSConnectionFactory.validateObject(Object) catches and ignores Throwable, which is a bit excessive. For example:

      if (rset != null) {
          try {
              rset.close();
          } catch (Throwable t) {
              // ignore
          }
      }
      

      close() can only throw SQLException, and that is all that should be ignored. In particular, ThreadDeath should never be ignored.

      Same applies to KeyedCPDSConnectionFactory.

      Basic[Managed]Datasource also catch Throwable, but rethrow it as SQLNestedException.
      This is a bit better, but there's still the problem with ThreadDeath.

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Sebb
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development