From derby-commits-return-12797-apmail-db-derby-commits-archive=db.apache.org@db.apache.org Mon Jun 14 15:12:14 2010 Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 90030 invoked from network); 14 Jun 2010 15:12:14 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Jun 2010 15:12:14 -0000 Received: (qmail 39665 invoked by uid 500); 14 Jun 2010 12:25:33 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 39581 invoked by uid 500); 14 Jun 2010 12:25:31 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 39552 invoked by uid 99); 14 Jun 2010 12:25:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jun 2010 12:25:30 +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.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jun 2010 12:25:27 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id CFF1B2388978; Mon, 14 Jun 2010 12:24:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r954425 - in /db/derby/code/branches/10.6: ./ java/client/org/apache/derby/client/ClientXAConnection.java java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java Date: Mon, 14 Jun 2010 12:24:40 -0000 To: derby-commits@db.apache.org From: kristwaa@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100614122440.CFF1B2388978@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kristwaa Date: Mon Jun 14 12:24:39 2010 New Revision: 954425 URL: http://svn.apache.org/viewvc?rev=954425&view=rev Log: DERBY-2532: Client does not return SQLException on XAConnection.getXAResource() on a closed connection, Embedded does Merged fix from trunk (revision 951346). Modified: db/derby/code/branches/10.6/ (props changed) db/derby/code/branches/10.6/java/client/org/apache/derby/client/ClientXAConnection.java db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java Propchange: db/derby/code/branches/10.6/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Jun 14 12:24:39 2010 @@ -1 +1 @@ -/db/derby/code/trunk:938547,938796,938959,939231,940462,940469,941627,942031,944152,946794,948045,948069,952138 +/db/derby/code/trunk:938547,938796,938959,939231,940462,940469,941627,942031,944152,946794,948045,948069,951346,952138 Modified: db/derby/code/branches/10.6/java/client/org/apache/derby/client/ClientXAConnection.java URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/client/org/apache/derby/client/ClientXAConnection.java?rev=954425&r1=954424&r2=954425&view=diff ============================================================================== --- db/derby/code/branches/10.6/java/client/org/apache/derby/client/ClientXAConnection.java (original) +++ db/derby/code/branches/10.6/java/client/org/apache/derby/client/ClientXAConnection.java Mon Jun 14 12:24:39 2010 @@ -25,10 +25,12 @@ import java.sql.SQLException; import javax.sql.XAConnection; import javax.transaction.xa.XAResource; +import org.apache.derby.client.am.ClientMessageId; import org.apache.derby.client.am.SqlException; import org.apache.derby.client.net.NetLogWriter; import org.apache.derby.client.net.NetXAConnection; import org.apache.derby.jdbc.ClientXADataSource; +import org.apache.derby.shared.common.reference.SQLState; public class ClientXAConnection extends ClientPooledConnection implements XAConnection { private static int rmIdSeed_ = 95688932; // semi-random starting value for rmId @@ -85,7 +87,12 @@ public class ClientXAConnection extends if (logWriter_ != null) { logWriter_.traceExit(this, "getXAResource", xares_); } - + // DERBY-2532 + if (super.physicalConnection_ == null) { + throw new SqlException(logWriter_, + new ClientMessageId(SQLState.NO_CURRENT_CONNECTION) + ).getSQLException(); + } return xares_; } Modified: db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java?rev=954425&r1=954424&r2=954425&view=diff ============================================================================== --- db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java (original) +++ db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java Mon Jun 14 12:24:39 2010 @@ -1855,12 +1855,9 @@ public class J2EEDataSourceTest extends // test methods against a closed XAConnection and its resource try { + // (DERBY-2532) xac2.getXAResource(); - // DERBY-2532 - // Network Server does not think this is worth an exception. - if (usingEmbedded()) - fail("expected SQLException on " + - "closed XAConnection.getXAResource"); + fail("expected SQLException on closed XAConnection.getXAResource"); } catch (SQLException sqle) { assertSQLState("08003", sqle); }