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

DataSource implementations do not implement Wrapper interface correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.8.0
    • 2.9.0
    • 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

              Unassigned Unassigned
              ralaoui Réda Housni Alaoui
              Votes:
              1 Vote for this issue
              Watchers:
              2 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