db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r383736 - in /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests: master/DerbyNetClient/jdk14/XATest.out master/XATest.out suites/derbynetclientmats.runall tests/jdbcapi/XATest.java
Date Tue, 07 Mar 2006 01:13:32 GMT
Author: djd
Date: Mon Mar  6 17:13:31 2006
New Revision: 383736

URL: http://svn.apache.org/viewcvs?rev=383736&view=rev
Log:
DERBY-434 Enable jdbcapi/XATest.java to be run under client. Several bugs exist and
are noted in the test or its output. All of these bugs are entered in Jira.

Merge of 380288 from trunk.

Added:
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/XATest.out
  (props changed)
      - copied unchanged from r380288, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/XATest.out
Modified:
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/XATest.out
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.runall
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java

Propchange: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/XATest.out
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/XATest.out
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/XATest.out?rev=383736&r1=383735&r2=383736&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/XATest.out
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/XATest.out
Mon Mar  6 17:13:31 2006
@@ -70,6 +70,7 @@
 2003       
 2005       
 2007       
+Correct XAException on starting a global transaction with an active local transaction (autocommit
false)
 EXPECTED SQLSTATE(XJ059): Cannot close a connection while a global transaction is still active.
 A          
 -----------
@@ -125,19 +126,19 @@
 Local(held) close Statement holdable CLOSE_CURSORS_AT_COMMIT 2
 ResultSet CLOSE_CURSORS_AT_COMMIT 2
   BC A=0
-EXPECTED SQLSTATE(XCL16): ResultSet not open. Operation 'next' not permitted. Verify that
autocommit is OFF.
+Non-held ResultSet correctly closed after commit
 Local(held) close PreparedStatement holdable CLOSE_CURSORS_AT_COMMIT 2
 ResultSet CLOSE_CURSORS_AT_COMMIT 2
   BC A=0
-EXPECTED SQLSTATE(XCL16): ResultSet not open. Operation 'next' not permitted. Verify that
autocommit is OFF.
+Non-held ResultSet correctly closed after commit
 Local(close) default Statement holdable CLOSE_CURSORS_AT_COMMIT 2
 ResultSet CLOSE_CURSORS_AT_COMMIT 2
   BC A=0
-EXPECTED SQLSTATE(XCL16): ResultSet not open. Operation 'next' not permitted. Verify that
autocommit is OFF.
+Non-held ResultSet correctly closed after commit
 Local(close) default PreparedStatement holdable CLOSE_CURSORS_AT_COMMIT 2
 ResultSet CLOSE_CURSORS_AT_COMMIT 2
   BC A=0
-EXPECTED SQLSTATE(XCL16): ResultSet not open. Operation 'next' not permitted. Verify that
autocommit is OFF.
+Non-held ResultSet correctly closed after commit
 Local(close) held Statement holdable HOLD_CURSORS_OVER_COMMIT 1
 ResultSet HOLD_CURSORS_OVER_COMMIT 1
   BC A=0
@@ -161,11 +162,11 @@
 Local(close) close Statement holdable CLOSE_CURSORS_AT_COMMIT 2
 ResultSet CLOSE_CURSORS_AT_COMMIT 2
   BC A=0
-EXPECTED SQLSTATE(XCL16): ResultSet not open. Operation 'next' not permitted. Verify that
autocommit is OFF.
+Non-held ResultSet correctly closed after commit
 Local(close) close PreparedStatement holdable CLOSE_CURSORS_AT_COMMIT 2
 ResultSet CLOSE_CURSORS_AT_COMMIT 2
   BC A=0
-EXPECTED SQLSTATE(XCL16): ResultSet not open. Operation 'next' not permitted. Verify that
autocommit is OFF.
+Non-held ResultSet correctly closed after commit
 BGBC 0
 BGAC 1
 START GLOBAL TRANSACTION

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.runall
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.runall?rev=383736&r1=383735&r2=383736&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.runall
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.runall
Mon Mar  6 17:13:31 2006
@@ -1,2 +1,3 @@
 jdbcapi/xaSimplePositive.sql
 jdbcapi/xaStateTran.sql
+jdbcapi/XATest.java

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java?rev=383736&r1=383735&r2=383736&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java
Mon Mar  6 17:13:31 2006
@@ -618,8 +618,10 @@
             xar.end(xid2, XAResource.TMSUSPEND);
 
             // DERBY-1004
-            if (TestUtil.isDerbyNetClientFramework())
+            if (TestUtil.isDerbyNetClientFramework()) {
+                System.out.println("DERBY-1004 Call conn.close to avoid exception with client");
                 conn.close();
+            }
 
             /*
              -- get local connection again
@@ -684,8 +686,10 @@
             rs.close();
 
             // DERBY-1004
-            if (TestUtil.isDerbyNetClientFramework())
+            if (TestUtil.isDerbyNetClientFramework()) {
+                System.out.println("DERBY-1004 Call conn.rollback to avoid exception with
client");
                 conn.rollback();
+            }
             /*
              -- yanking a local connection away should rollback the changes
              */
@@ -706,12 +710,11 @@
             Xid xid3 = XATestUtil.getXid(1003, 27, 9);
             try {
                 xar.start(xid3, XAResource.TMNOFLAGS);
+                System.out.println("FAIL XAResource.start on a global transaction with an
active local transaction (autocommit false)");
             } catch (XAException xae) {
-                if ((xae.errorCode != XAException.XAER_OUTSIDE)
-                    &&
-                    // DERBY-1024
-                    (xae.errorCode != XAException.XAER_RMFAIL))
+                if (xae.errorCode != XAException.XAER_OUTSIDE)
                     throw xae;
+                System.out.println("Correct XAException on starting a global transaction
with an active local transaction (autocommit false)");
             }
             conn.commit();
             xar.start(xid3, XAResource.TMNOFLAGS);
@@ -720,6 +723,9 @@
              -- now I shouldn't be able to yank it
              xa_getconnection;
              */
+            if (TestUtil.isDerbyNetClientFramework()) {
+                System.out.println("DERBY-341 - Client skipping XAConnection with active
local transaction");              
+            } else {
             try {
                 xac.getConnection();
                 System.out
@@ -727,6 +733,7 @@
             } catch (SQLException sqle) {
                 TestUtil.dumpSQLExceptions(sqle, true);
             }
+            }
             /*
              select * from foo;
              delete from foo;
@@ -874,8 +881,10 @@
             // an implicit commit to complete the local transaction.
             
             // DERBY-1025 Client only bug
-            if (TestUtil.isDerbyNetClientFramework())
+            if (TestUtil.isDerbyNetClientFramework()) {
+                System.out.println("DERBY-1025 Call conn.commit to avoid exception with client");
                 conn.commit();
+            }
             System.out.println("START GLOBAL TRANSACTION");
             // start a global xact and test those statements.
             xar.start(xid, XAResource.TMNOFLAGS);
@@ -984,7 +993,21 @@
                System.out.println("FAIL: non-held cursor not closed by commit");
         } catch (SQLException sqle)
         {
-             TestUtil.dumpSQLExceptions(sqle, !held);
+            boolean ok = !held;
+            boolean showError = true;
+            if (ok) {
+                if (TestUtil.isEmbeddedFramework()) {
+                    if ("XCL16".equals(sqle.getSQLState()))
+                        showError = false;
+                } else if (TestUtil.isDerbyNetClientFramework()) {
+                    // No SQL state yet from client error.
+                    showError = false;
+                }
+            }
+            if (showError)
+                TestUtil.dumpSQLExceptions(sqle, ok);
+            else if (ok)
+                System.out.println("Non-held ResultSet correctly closed after commit");
         }
         
         rs.close();



Mime
View raw message