Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D13216DDD for ; Mon, 16 May 2011 23:39:33 +0000 (UTC) Received: (qmail 16523 invoked by uid 500); 16 May 2011 23:39:33 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 16457 invoked by uid 500); 16 May 2011 23:39:33 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 16449 invoked by uid 99); 16 May 2011 23:39:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 May 2011 23:39:33 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 May 2011 23:39:31 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 663F1CD2FD for ; Mon, 16 May 2011 23:38:47 +0000 (UTC) Date: Mon, 16 May 2011 23:38:47 +0000 (UTC) From: "Clement Pang (JIRA)" To: issues@commons.apache.org Message-ID: <1852774226.17264.1305589127415.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (DBCP-327) XAConnection is not closed MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DBCP-327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13034426#comment-13034426 ] Clement Pang commented on DBCP-327: ----------------------------------- Not sure what's the workaround stated in the description is (other than to not use DBCP). Basically, one cannot use XA mySQL connections with DBCP if this bug is not fixed (since connections will never be closed properly). > XAConnection is not closed > -------------------------- > > Key: DBCP-327 > URL: https://issues.apache.org/jira/browse/DBCP-327 > Project: Commons Dbcp > Issue Type: Bug > Affects Versions: 1.4 > Environment: MySQL Connector/J 5.1.12; JOTM 2.1.9; propesed solution is tested with Derby 10.5.3.0_1 as well > Reporter: Sergey Vladimirov > Priority: Minor > Labels: connection, leak, mysql, transactions, xa > Fix For: 1.3.1 > > Attachments: MySQL and DBCP.zip > > Original Estimate: 8h > Remaining Estimate: 8h > > After creation of connection in DataSourceXAConnectionFactory::createConnection() the instance of XAConnection is ready to be garbage collected. But in MySQL Connector/J this instance holds the real physiscal connection to MySQL server. Thus, simple test case (in attach) opens 2 connections to server and the first one can be considered as "leak". > The possible solution is to close "parent" XA connection as soon as "child" Connection is closed as well. Due to compatibility issues it may be an option for BasicManagerDataSource. However, Derby seems okay with both variants (according to my test cases with JOTM/Hibernate/Derby/DBCP(+-patch)) > In the attachment - "manual" test case, since i don't know how to count real MySQL connection number in runtime. When BasicManagedDataSource is used (change it at ~43) we can create breakpoint at line "connection.close();" (~115). According to MySQL Administrator there are 2 connections, but according to pool - only one. If BasicManagedDataSourceXAClose is used - first connection correclty closed. > This issue created serious problems in out production system, but, due to existing workaround (replace BasicManagedDataSource and DataSourceXAConnectionFactory) priority is minor. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira