You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Réda Housni Alaoui (Jira)" <ji...@apache.org> on 2021/06/01 09:23:00 UTC

[jira] [Commented] (DBCP-573) DataSource implementations do not implement Wrapper interface correctly

    [ https://issues.apache.org/jira/browse/DBCP-573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17354962#comment-17354962 ] 

Réda Housni Alaoui commented on DBCP-573:
-----------------------------------------

Looks good to me.

Thank you !

> DataSource implementations do not implement Wrapper interface correctly
> -----------------------------------------------------------------------
>
>                 Key: DBCP-573
>                 URL: https://issues.apache.org/jira/browse/DBCP-573
>             Project: Commons DBCP
>          Issue Type: Bug
>    Affects Versions: 2.8.0
>            Reporter: Réda Housni Alaoui
>            Priority: Major
>             Fix For: 2.9.0
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Let's take {{BasicDataSource}} as an example. Its code is currently:
> {code:java}
> @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.");
> }{code}
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)