Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 43297 invoked from network); 27 Apr 2010 00:25:56 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Apr 2010 00:25:56 -0000 Received: (qmail 95431 invoked by uid 500); 27 Apr 2010 00:25:56 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 95401 invoked by uid 500); 27 Apr 2010 00:25:56 -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 95392 invoked by uid 99); 27 Apr 2010 00:25:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Apr 2010 00:25:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Apr 2010 00:25:53 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o3R0PV6D000294 for ; Tue, 27 Apr 2010 00:25:32 GMT Message-ID: <11791461.21901272327931866.JavaMail.jira@thor> Date: Mon, 26 Apr 2010 20:25:31 -0400 (EDT) From: "Kathey Marsden (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-4314) With derby client setTransactionIsolation executes and commits even if isolation has not changed In-Reply-To: <1870676010.1247863574804.JavaMail.jira@brutus> 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/DERBY-4314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12861181#action_12861181 ] Kathey Marsden commented on DERBY-4314: --------------------------------------- I noticed, with the patch, if I add Statement s = cs1.createStatement(); s.executeUpdate("create table foo (i int)"); just before xar.end(xid, XAResource.TMSUCCESS); I get on the subsequent cs1 = xaconn.getConnection(); $ java ReproIsoLost 2010-04-27 00:18:34.201 GMT : Apache Derby Network Server - 10.7.0.0 alpha - (93 8130:938140M) started and ready to accept connections on port 1597 Exception in thread "main" java.sql.SQLNonTransientConnectionException: An error occurred during connect reset and the connection has been terminated. See chai ned exceptions for details. at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(SQLE xceptionFactory40.java:70) at org.apache.derby.client.am.SqlException.getSQLException(SqlException. java:358) at org.apache.derby.client.ClientPooledConnection.getConnection(ClientPo oledConnection.java:259) at org.apache.derby.client.ClientXAConnection.getConnection(ClientXAConn ection.java:70) at ReproIsoLost.main(ReproIsoLost.java:51) Caused by: org.apache.derby.client.am.DisconnectException: An error occurred dur ing connect reset and the connection has been terminated. See chained exception s for details. at org.apache.derby.client.am.Connection.reset(Connection.java:2175) at org.apache.derby.client.ClientPooledConnection.getConnection(ClientPo oledConnection.java:245) ... 2 more In the derby.log I have: , (SESSIONID = 3), (DATABASE = wombat), (DRDAID = NF000001.GC36-867504605894726310{2}), Failed Statement is: SET CURRENT ISOLATION = CS ERROR X0Y77: Cannot issue set transaction isolation statement on a global transaction that is in progress because it would have implicitly committed the global transaction. at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:276) at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.setIsolationLevel(GenericLanguageConnectionContext.java:2650) at org.apache.derby.impl.sql.execute.SetTransactionIsolationConstantAction.executeConstantAction(SetTransactionIsolationConstantAction.java:86) at org.apache.derby.impl.sql.execute.MiscResultSet.open(MiscResultSet.java:61) at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1232) at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:625) at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(EmbedStatement.java:175) at org.apache.derby.iapi.jdbc.BrokeredStatement.executeUpdate(BrokeredStatement.java:113) at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLIMM(DRDAConnThread.java:5133) at org.apache.derby.impl.drda.DRDAConnThread.processCommands(DRDAConnThread.java:755) at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:295) Cleanup action completed This passes with 10.5 and presumably without the patch. > With derby client setTransactionIsolation executes and commits even if isolation has not changed > ------------------------------------------------------------------------------------------------- > > Key: DERBY-4314 > URL: https://issues.apache.org/jira/browse/DERBY-4314 > Project: Derby > Issue Type: Improvement > Components: JDBC, Network Client > Affects Versions: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.1.1, 10.6.1.0 > Reporter: Kathey Marsden > Priority: Minor > Attachments: DERBY-4314-2.diff, DERBY-4314-3.diff, DERBY-4314-5.diff, derby-4314-6a-initial_piggybacking.diff, derby-4314-6a-initial_piggybacking.stat, DERBY-4314-6b-combinepiggybacking.diff, DERBY-4314-6c-combineaftermerge.diff, DERBY-4314.diff, ReproIsoLost.java, TestConnReuse.java, utilXid.java > > > With in EmbedConnection.setIsolation() we have a check to see if the isolation level is the same and if so just return without doing a commit: > public void setTransactionIsolation(int level) throws SQLException { > if (level == getTransactionIsolation()) > return; > with org.apache.derby.client.am.Connection we have no such check. It would be good if the client driver acted like embedded. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.