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

InstanceKeyDataSource discards native SQLException when given password does not match password used to create the connection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.1
    • None

    Description

      The throw in InstanceKeyDataSource at line 936 does not pass on the native SQL exception from the connection test:

      } catch (SQLException ex) {
                      // Password has not changed, so refuse client, but return connection to the pool
                      closeDueToException(info);
                      throw new SQLException("Given password did not match password used"
                                             + " to create the PooledConnection.");
                  }
      

      It would be great if this throw could include the cause exception:

                      throw new SQLException("Given password did not match password used"
                                             + " to create the PooledConnection.", ex);
      

      as we have code that detects login related SQLExceptions and takes actions on them.

      Attachments

        1. dbcp_420_patch.txt
          5 kB
          Bjorn Vidar Remme

        Activity

          People

            Unassigned Unassigned
            rembjo0 Bjorn Vidar Remme
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: