Commons Dbcp
  1. Commons Dbcp
  2. DBCP-313

PooledConnection.removeConnectionEventListener(ConnectionEventListener) does not throw any Exceptions, yet DBCP protects calls to it

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      javax.sql.PooledConnection.removeConnectionEventListener(ConnectionEventListener) does not throw any Exceptions, yet DBCP protects calls to it, generally ignoring any Exception.

      For example, in datasources.CPDSConnectionFactory:

      public void destroyObject(Object obj) throws Exception {
          if (obj instanceof PooledConnectionAndInfo) {
              PooledConnection pc = ((PooledConnectionAndInfo)obj).getPooledConnection();
              try {
                  pc.removeConnectionEventListener(this);
              } catch (Exception e) {
                  //ignore
              }
      ....
      

      This seems wrong, as the code may accidentally swallow a genuine Exception.

        Activity

        Phil Steitz made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Sebb made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Sebb created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development