[ 
https://issues.apache.org/jira/browse/DBCP-558?focusedWorklogId=342722&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-342722
 ]

ASF GitHub Bot logged work on DBCP-558:
---------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Nov/19 17:03
            Start Date: 13/Nov/19 17:03
    Worklog Time Spent: 10m 
      Work Description: louislatreille commented on pull request #35: DBCP-558 
Fix DelegatingConnection readOnly and autoCommit caching mechanism
URL: https://github.com/apache/commons-dbcp/pull/35
 
 
   https://issues.apache.org/jira/browse/DBCP-558
   
   Previously, we would cache the input of setReadOnly and setAutoCommit 
directly without checking if the underlying connection succeeded in setting the 
configuration parameter. This would result in wrong results from isReadOnly and 
getAutoCommit if the underlying connection didn't support 
read-only/non-read-only or auto-commit/non-auto-commit connections, as with 
SqlServerConnection.
   
   This fixes the issue by caching what is return by isReadOnly and 
getAutoCommit from the underlying connection.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

            Worklog Id:     (was: 342722)
    Remaining Estimate: 0h
            Time Spent: 10m

> 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.7.1
>
>          Time Spent: 10m
>  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)

Reply via email to