db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kristian Waagan (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (DERBY-5561) Race conditions in LogicalConnection checking for a null physical connection
Date Wed, 30 May 2012 10:20:23 GMT

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

Kristian Waagan resolved DERBY-5561.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.9.1.1
                   10.8.2.3
         Assignee: Brett Bergquist  (was: Siddharth Srivastava)

Backported to 10.8 with revision 1344183.
Resolving issue.
                
> Race conditions in LogicalConnection checking for a null physical connection
> ----------------------------------------------------------------------------
>
>                 Key: DERBY-5561
>                 URL: https://issues.apache.org/jira/browse/DERBY-5561
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.8.2.2
>         Environment: Solaris 10
> Glassfish V2.1.1
> ClientXADataSource connection pool
>            Reporter: Brett Bergquist
>            Assignee: Brett Bergquist
>              Labels: derby_triage10_9
>             Fix For: 10.8.2.3, 10.9.1.1
>
>         Attachments: DERBY-5561.patch, derby-5561-2a-minor_cleanups.diff
>
>
> There are race conditions with checkForNullPhysicalConnection calls in LogicalConnection.
 checkForNullPhysicalConnection is not synchronized and it checks for the member "phsyicalConnection"
which can be cleared by "nullPhsyicalConnection" (which is synchronized) and "close" (which
is synchronized) and "closeWithoutRecyclingToPool" (which is synchronized).
> This affects "nativeSQL", "getAutoCommit", "getTransactionIsolation", "getWarnings",
"isReadOnly", "getCatalog", "getTypeMap", "createStatement", "prepareCall", "prepareStatement",
"setHoldability", "getHoldability", "setSavePoint", "rollBack", "releaseSavePoint", "getSchema",
"setSchema".
> All of these call "checkForNullPhysicalConnection" and then use the member "physicalConnection"
after that call returns.  Because these methods are not synchronized, between the time "checkForNullPhysicalConnectoin"
returns and "physicalConnection" is used, the "physicalConnection" member could be set to
null and then a NPE occurs.
> Probably all of these methods should be changed to synchronized.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message