Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DA334D5F2 for ; Wed, 19 Sep 2012 21:04:07 +0000 (UTC) Received: (qmail 26732 invoked by uid 500); 19 Sep 2012 21:04:07 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 26674 invoked by uid 500); 19 Sep 2012 21:04:07 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 26666 invoked by uid 99); 19 Sep 2012 21:04:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2012 21:04:07 +0000 Date: Thu, 20 Sep 2012 08:04:07 +1100 (NCT) From: "Mamta A. Satoor (JIRA)" To: derby-dev@db.apache.org Message-ID: <1296595176.99469.1348088647669.JavaMail.jiratomcat@arcas> In-Reply-To: <1008737819.48689.1325086110673.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Assigned] (DERBY-5561) Race conditions in LogicalConnection checking for a null physical connection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-5561?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mamta A. Satoor reassigned DERBY-5561: -------------------------------------- Assignee: Mamta A. Satoor (was: Kristian Waagan) > 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.5.3.2, 10.8.2.2 > Environment: Solaris 10 > Glassfish V2.1.1 > ClientXADataSource connection pool > Reporter: Brett Bergquist > Assignee: Mamta A. Satoor > Fix For: 10.7.1.4, 10.8.2.3, 10.9.1.1 > > Attachments: derby-5561-2a-minor_cleanups.diff, DERBY-5561.patch > > > 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 For more information on JIRA, see: http://www.atlassian.com/software/jira