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

DataSource implementations do not implement Wrapper interface correctly

    XMLWordPrintableJSON

    Details

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

      Description

      Let's take BasicDataSource as an example. Its code is currently:

      @Override
      public boolean isWrapperFor(final Class<?> iface) throws SQLException {
          return false;
      }
      
      @Override
      public <T> T unwrap(final Class<T> iface) throws SQLException {
          throw new SQLException("BasicDataSource is not a wrapper.");
      }

      This breaks consumers relying on Wrapper being correctly implemented.

      The DataSource should at least check if this is an instance of iface and return it from unwrap if it is.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ralaoui Réda Housni Alaoui
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m