db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r966027 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java
Date Tue, 20 Jul 2010 21:45:31 GMT
Author: mikem
Date: Tue Jul 20 21:45:31 2010
New Revision: 966027

URL: http://svn.apache.org/viewvc?rev=966027&view=rev
Log:
DERBY-4743 Attempt to access a DECLARE GLOBAL TEMPORARY TABLE after commit in an XA transaction
in Network server fails.

The fix for DERBY-4731 made the behavior consistent across embedded and 
network server.  Derby does not support accessing global temporary tables 
declared in an XA transaction subsequent to the commit of the transaction.

This change updates the junit XATest to verify that accessing the table after
the commit fails as expected in both the embedded and network server case.  In
both cases you will get the generic table does not exist error.



Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java?rev=966027&r1=966026&r2=966027&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java
Tue Jul 20 21:45:31 2010
@@ -1116,14 +1116,14 @@ public class XATest extends BaseJDBCTest
     /**
      * DERBY-4743 Temp tables with XA transactions
      *
-     * Will throw an error in network server when attempt is made to 
-     * access the global temporary table after the end and commit.
+     * Verifies that global temporary table can not be accessed after the
+     * commit of the XA transaction.
      *
      * @throws XAException 
      * @throws SQLException 
      * 
      */
-    public void xtestXATempTableD4743() 
+    public void testXATempTableD4743() 
         throws SQLException, XAException {
 
           doXATempTableD4731Work(true, true, XATestUtil.getXid(998, 10, 50));
@@ -1185,10 +1185,10 @@ public class XATest extends BaseJDBCTest
 
         if (access_temp_table_after_xaendandcommit)
         {
-            // is temp table empty after the commit?
-            rs = s.executeQuery("SELECT count(*) FROM SESSION.t1");
-            JDBC.assertFullResultSet(rs, new String[][] {{"0"}});
-            rs.close();
+            // temp table should not be available after commit of an XA
+            // transaction.
+            assertStatementError(
+                "42X05", s, "SELECT count(*) FROM SESSION.t1");
             conn.commit();
         }
 



Mime
View raw message