Commons Dbcp
  1. Commons Dbcp
  2. DBCP-322

CPDSConnectionFactory.validateObject(Object) ignores Throwable

    Details

    • Type: Bug Bug
    • Status: Resolved
    • 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

        Sebb created issue -
        Hide
        Phil Steitz added a comment -

        Agree this is excessive. Need to look carefully at each instance.

        Show
        Phil Steitz added a comment - Agree this is excessive. Need to look carefully at each instance.
        Phil Steitz made changes -
        Field Original Value New Value
        Fix Version/s 1.3.1 [ 12314492 ]
        Fix Version/s 1.4.1 [ 12314493 ]
        Affects Version/s 1.4 [ 12312615 ]
        Affects Version/s 1.3 [ 12311977 ]
        Affects Version/s 1.2.2 [ 12311976 ]
        Affects Version/s 1.2.1 [ 12311975 ]
        Affects Version/s 1.2 [ 12311721 ]
        Hide
        Phil Steitz added a comment -

        This is a behavior change that could conceivably break some applications, so pushing to 2.0

        Show
        Phil Steitz added a comment - This is a behavior change that could conceivably break some applications, so pushing to 2.0
        Phil Steitz made changes -
        Fix Version/s 2.0 [ 12313721 ]
        Fix Version/s 1.3.1 [ 12314492 ]
        Fix Version/s 1.4.1 [ 12314493 ]
        Hide
        Sebb added a comment -

        Fixed all instances of Throwable that were being ignored.
        Ignoring Exception instead.

        Show
        Sebb added a comment - Fixed all instances of Throwable that were being ignored. Ignoring Exception instead.
        Sebb made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development