db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r963931 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java
Date Wed, 14 Jul 2010 02:54:59 GMT
Author: mikem
Date: Wed Jul 14 02:54:58 2010
New Revision: 963931

URL: http://svn.apache.org/viewvc?rev=963931&view=rev
Log:
DERBY-4743

Checking in changes to XATest.java to repro this bug.  The test case is currently
disabled.  To enable it remove the x from:
    public void xtestXATempTableD4743()


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=963931&r1=963930&r2=963931&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
Wed Jul 14 02:54:58 2010
@@ -1093,12 +1093,12 @@ public class XATest extends BaseJDBCTest
      */
     public void testXATempTableD4731_RawStore() 
         throws SQLException, XAException {
-        doXATempTableD4731Work(true, XATestUtil.getXid(997, 9, 49));
+        doXATempTableD4731Work(true, false, XATestUtil.getXid(997, 9, 49));
     }
     
 
     /**
-     * DERBY-XXXX Temp tables with XA transactions
+     * DERBY-4735 Temp tables with XA transactions
      * an Assert will occur on prepare if only
      * temp table work is done in the xact.
      *
@@ -1106,10 +1106,27 @@ public class XATest extends BaseJDBCTest
      * @throws SQLException 
      * 
      */
-    public void xtestXATempTableDXXXX_Assert() 
+    public void xtestXATempTableD4735_Assert() 
         throws SQLException, XAException {
 
-          doXATempTableD4731Work(false, XATestUtil.getXid(998, 10, 50));
+          doXATempTableD4731Work(false, false, XATestUtil.getXid(999,  11, 51));
+          doXATempTableD4731Work(false, true,  XATestUtil.getXid(1000, 12, 52));
+    }
+
+    /**
+     * 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.
+     *
+     * @throws XAException 
+     * @throws SQLException 
+     * 
+     */
+    public void xtestXATempTableD4743() 
+        throws SQLException, XAException {
+
+          doXATempTableD4731Work(true, true, XATestUtil.getXid(998, 10, 50));
     }
  
     
@@ -1124,6 +1141,7 @@ public class XATest extends BaseJDBCTest
      */
     private void doXATempTableD4731Work(
     boolean doLoggedWorkInXact,
+    boolean access_temp_table_after_xaendandcommit,
     Xid     xid)
         throws SQLException, XAException{
 
@@ -1163,11 +1181,20 @@ public class XATest extends BaseJDBCTest
             xar.prepare(xid));
 
         xar.commit(xid,false); 
+
+        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"}});
+        }
+
         s.close();
         conn.close();
         xaconn.close();
     }
 
+
     private void makeARealTable(Statement s) throws SQLException {
         try {
             s.executeUpdate("DROP TABLE REALTABLE1");



Mime
View raw message