Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 83937 invoked from network); 14 Nov 2006 17:59:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Nov 2006 17:59:01 -0000 Received: (qmail 515 invoked by uid 500); 14 Nov 2006 17:59:10 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 480 invoked by uid 500); 14 Nov 2006 17:59:10 -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 470 invoked by uid 99); 14 Nov 2006 17:59:10 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Nov 2006 09:59:10 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Nov 2006 09:58:59 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4CCBF7142F5 for ; Tue, 14 Nov 2006 09:58:38 -0800 (PST) Message-ID: <1816701.1163527118311.JavaMail.jira@brutus> Date: Tue, 14 Nov 2006 09:58:38 -0800 (PST) From: "Deepa Remesh (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-2084) getTransactionIsolation() in network client should not activate a transaction In-Reply-To: <7635963.1163507498266.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/DERBY-2084?page=comments#action_12449717 ] Deepa Remesh commented on DERBY-2084: ------------------------------------- Bernt, I verified that your patch fixes the problem reported. I hadn't realized that the fix for DERBY-1148 would lead to this bug. As an aside, I relooked at my patch for DERBY-1148. And I am wondering if the storing and saving of autocommit value is needed. I am checking if the below statement (and related statements) serve any purpose: // Store the current auto-commit value and use it to restore // at the end of this method. boolean currentAutoCommit = autoCommit_; I did some quick checks with and without these statements and seem to get same results. Any thoughts on this? > getTransactionIsolation() in network client should not activate a transaction > ----------------------------------------------------------------------------- > > Key: DERBY-2084 > URL: http://issues.apache.org/jira/browse/DERBY-2084 > Project: Derby > Issue Type: Bug > Components: Network Client > Affects Versions: 10.2.1.6, 10.3.0.0, 10.1.3.1 > Reporter: Bernt M. Johnsen > Assigned To: Bernt M. Johnsen > Attachments: DERBY-2084.diff > > > getTransactionIsolation() is implemented by means of > rs = getTransactionIsolationStmt.executeQuery("values current isolation"); > This will activate a transaction. Thus the code snippet > Connection conn = > DriverManager.getConnection(url); > conn.setAutoCommit(false); > int tx = conn.getTransactionIsolation(); > conn.close(); > will fail with > java.sql.SQLException: Cannot close a connection while a transaction is still active. > at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source) > at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source) > at org.apache.derby.client.am.Connection.closeResourcesX(Unknown Source) > at org.apache.derby.client.am.Connection.closeX(Unknown Source) > at org.apache.derby.client.net.NetConnection.closeX(Unknown Source) > at org.apache.derby.client.am.Connection.close(Unknown Source) > at org.apache.derby.client.net.NetConnection.close(Unknown Source) > at GetTransactionIsolation.test(GetTransactionIsolation.java:12) > at GetTransactionIsolation.main(GetTransactionIsolation.java:22) > Caused by: org.apache.derby.client.am.SqlException: Cannot close a connection while a transaction is still active. > at org.apache.derby.client.am.Connection.checkForTransactionInProgress(Unknown Source) > ... 7 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira