You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2021/07/07 15:01:00 UTC

[jira] [Resolved] (DBCP-558) DelegatingConnection setReadOnly and setAutoCommit sometimes caches the wrong value

     [ https://issues.apache.org/jira/browse/DBCP-558?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory resolved DBCP-558.
----------------------------------
    Fix Version/s: 2.8.0
       Resolution: Fixed

[garydgregory|https://github.com/garydgregory] merged commit [{{79422dc}}|https://github.com/apache/commons-dbcp/commit/79422dc193221b745617984d30c321436c2a849c] into apache:master [on Aug 10, 2020|https://github.com/apache/commons-dbcp/pull/35#event-3640210267]

> DelegatingConnection setReadOnly and setAutoCommit sometimes caches the wrong value
> -----------------------------------------------------------------------------------
>
>                 Key: DBCP-558
>                 URL: https://issues.apache.org/jira/browse/DBCP-558
>             Project: Commons DBCP
>          Issue Type: Bug
>    Affects Versions: 2.2.0
>            Reporter: Louis Latreille
>            Priority: Minor
>             Fix For: 2.8.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> DelegatingConnection caches the input of setReadOnly and setAutoCommit directly without checking if the underlying connection succeeded in setting the configuration parameter. This results in wrong return value from isReadOnly and getAutoCommit if the underlying connection doesn't support read-only/non-read-only or auto-commit/non-auto-commit connections, as with SqlServerConnection.
>  
> To reproduce the issue:
>  # Create a DelegatingConnection with an underlying SqlServerConnection
>  # Set the connection read-only `con.setReadOnly(true)`
>  # Query the read-only state on the DelegatingConnection, you will get true
>  # Query the read-only state of the underlying SqlServerConnection, you will get false (SqlServer JDBC driver doesn't support read-only connections)



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