db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r380288 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master/DerbyNetClient/jdk14/XATest.out master/XATest.out suites/derbynetclientmats.runall tests/jdbcapi/XATest.java
Date Fri, 24 Feb 2006 00:52:41 GMT
Author: djd
Date: Thu Feb 23 16:52:39 2006
New Revision: 380288

URL: http://svn.apache.org/viewcvs?rev=380288&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.

Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/XATest.out
  (with props)
Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/XATest.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.runall
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/XATest.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/XATest.out?rev=380288&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/XATest.out
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/XATest.out
Thu Feb 23 16:52:39 2006
@@ -0,0 +1,195 @@
+initial Connection holdable HOLD_CURSORS_OVER_COMMIT 1
+singleConnectionOnePhaseCommit
+XA Connection holdable CLOSE_CURSORS_AT_COMMIT 2
+XA Statement holdable CLOSE_CURSORS_AT_COMMIT 2
+A          
+-----
+0          
+GXID |STATUS |READONLY |USERNAME |TYPE                          
+-----
+(0 |ACTIVE |false |APP |UserTransaction               
+interleavingTransactions
+GXID |STATUS |READONLY |USERNAME |TYPE                          
+-----
+(1 |ACTIVE |false |SKU |UserTransaction               
+(2 |ACTIVE |false |SKU |UserTransaction               
+GXID |STATUS |READONLY |USERNAME |TYPE                          
+-----
+(1 |ACTIVE |false |SKU |UserTransaction               
+(2 |ACTIVE |false |SKU |UserTransaction               
+GXID |STATUS |READONLY |USERNAME |TYPE                          
+-----
+(1 |PREPARED |false |SKU |UserTransaction               
+(2 |PREPARED |false |SKU |UserTransaction               
+recovered start 2
+recovered 0
+recovered end 0
+GXID |STATUS |READONLY |USERNAME |TYPE                          
+-----
+(3 |IDLE |NULL |SKU |UserTransaction               
+A          
+-----
+0          
+1          
+3          
+noTransaction
+morph
+GXID |STATUS |READONLY |USERNAME |TYPE                          
+-----
+GXID |STATUS |READONLY |USERNAME |TYPE                          
+-----
+GXID |STATUS |READONLY |USERNAME |TYPE                          
+-----
+(1 |IDLE |NULL |APP |UserTransaction               
+EXPECTED SQLSTATE(XJ05C): Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a
global transaction.
+Statement created in global has holdabilty: false
+A          
+-----
+2001       
+2002       
+2003       
+DERBY-1004 Call conn.close to avoid exception with client
+GXID |STATUS |READONLY |USERNAME |TYPE                          
+-----
+(1 |PREPARED |false |APP |UserTransaction               
+(1 |IDLE |NULL |APP |UserTransaction               
+GXID |STATUS |READONLY |USERNAME |TYPE                          
+-----
+A          
+-----
+2001       
+2002       
+2003       
+2005       
+2007       
+A          
+-----
+DERBY-1004 Call conn.rollback to avoid exception with client
+A          
+-----
+2001       
+2002       
+2003       
+2005       
+2007       
+Correct XAException on starting a global transaction with an active local transaction (autocommit
false)
+DERBY-341 - Client skipping XAConnection with active local transaction
+A          
+-----
+A          
+-----
+2001       
+2002       
+2003       
+2005       
+2007       
+derby966
+Local Connection holdable HOLD_CURSORS_OVER_COMMIT 1
+Local(held) default Statement holdable HOLD_CURSORS_OVER_COMMIT 1
+FAIL - mismatched statement & Connection
+ResultSet HOLD_CURSORS_OVER_COMMIT 1
+  BC A=0
+  AC A=1
+  AC A=3
+  AC A=2001
+  AC A=2002
+  AC A=2003
+  AC A=2005
+  AC A=2007
+Local(held) default PreparedStatement holdable HOLD_CURSORS_OVER_COMMIT 1
+FAIL - mismatched statement & Connection
+ResultSet HOLD_CURSORS_OVER_COMMIT 1
+  BC A=0
+  AC A=1
+  AC A=3
+  AC A=2001
+  AC A=2002
+  AC A=2003
+  AC A=2005
+  AC A=2007
+Local(held) held Statement holdable HOLD_CURSORS_OVER_COMMIT 1
+FAIL - mismatched statement & Connection
+ResultSet HOLD_CURSORS_OVER_COMMIT 1
+  BC A=0
+  AC A=1
+  AC A=3
+  AC A=2001
+  AC A=2002
+  AC A=2003
+  AC A=2005
+  AC A=2007
+Local(held) held PreparedStatement holdable HOLD_CURSORS_OVER_COMMIT 1
+FAIL - mismatched statement & Connection
+ResultSet HOLD_CURSORS_OVER_COMMIT 1
+  BC A=0
+  AC A=1
+  AC A=3
+  AC A=2001
+  AC A=2002
+  AC A=2003
+  AC A=2005
+  AC A=2007
+Local(held) close Statement holdable CLOSE_CURSORS_AT_COMMIT 2
+FAIL - mismatched statement & Connection
+ResultSet CLOSE_CURSORS_AT_COMMIT 2
+  BC A=0
+Non-held ResultSet correctly closed after commit
+Local(held) close PreparedStatement holdable CLOSE_CURSORS_AT_COMMIT 2
+FAIL - mismatched statement & Connection
+ResultSet CLOSE_CURSORS_AT_COMMIT 2
+  BC A=0
+Non-held ResultSet correctly closed after commit
+Local(close) default Statement holdable CLOSE_CURSORS_AT_COMMIT 2
+FAIL - mismatched statement & Connection
+ResultSet CLOSE_CURSORS_AT_COMMIT 2
+  BC A=0
+Non-held ResultSet correctly closed after commit
+Local(close) default PreparedStatement holdable CLOSE_CURSORS_AT_COMMIT 2
+FAIL - mismatched statement & Connection
+ResultSet CLOSE_CURSORS_AT_COMMIT 2
+  BC A=0
+Non-held ResultSet correctly closed after commit
+Local(close) held Statement holdable HOLD_CURSORS_OVER_COMMIT 1
+FAIL - mismatched statement & Connection
+ResultSet HOLD_CURSORS_OVER_COMMIT 1
+  BC A=0
+  AC A=1
+  AC A=3
+  AC A=2001
+  AC A=2002
+  AC A=2003
+  AC A=2005
+  AC A=2007
+Local(close) held PreparedStatement holdable HOLD_CURSORS_OVER_COMMIT 1
+FAIL - mismatched statement & Connection
+ResultSet HOLD_CURSORS_OVER_COMMIT 1
+  BC A=0
+  AC A=1
+  AC A=3
+  AC A=2001
+  AC A=2002
+  AC A=2003
+  AC A=2005
+  AC A=2007
+Local(close) close Statement holdable CLOSE_CURSORS_AT_COMMIT 2
+FAIL - mismatched statement & Connection
+ResultSet CLOSE_CURSORS_AT_COMMIT 2
+  BC A=0
+Non-held ResultSet correctly closed after commit
+Local(close) close PreparedStatement holdable CLOSE_CURSORS_AT_COMMIT 2
+FAIL - mismatched statement & Connection
+ResultSet CLOSE_CURSORS_AT_COMMIT 2
+  BC A=0
+Non-held ResultSet correctly closed after commit
+BGBC 0
+BGAC 1
+DERBY-1025 Call conn.commit to avoid exception with client
+START GLOBAL TRANSACTION
+EXPECTED SQLSTATE(XJ05C): Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a
global transaction.
+EXPECTED SQLSTATE(XJ05C): Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a
global transaction.
+EXPECTED SQLSTATE(XJ05C): Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a
global transaction.
+EXPECTED SQLSTATE(XJ05C): Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a
global transaction.
+EXPECTED SQLSTATE(XJ05C): Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a
global transaction.
+EXPECTED SQLSTATE(XJ05C): Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a
global transaction.
+derby966 complete
+XATest complete

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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/XATest.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/XATest.out?rev=380288&r1=380287&r2=380288&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/XATest.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/XATest.out
Thu Feb 23 16:52:39 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/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.runall
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.runall?rev=380288&r1=380287&r2=380288&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.runall
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.runall
Thu Feb 23 16:52:39 2006
@@ -2,3 +2,4 @@
 jdbcapi/xaSimplePositive.sql
 jdbcapi/xaStateTran.sql
 jdbcapi/lobStreams.java
+jdbcapi/XATest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java?rev=380288&r1=380287&r2=380288&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
Thu Feb 23 16:52:39 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