You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by km...@apache.org on 2006/06/07 04:45:55 UTC

svn commit: r412259 - in /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests: master/DerbyNetClient/checkDataSource30.out suites/DerbyNetClient.exclude tests/jdbcapi/checkDataSource30.java

Author: kmarsden
Date: Tue Jun  6 19:45:54 2006
New Revision: 412259

URL: http://svn.apache.org/viewvc?rev=412259&view=rev
Log:
DERBY-435 -  jdbcapi/checkDataSource.java and jdbapi/checkDataSource30.java to tests should be changed or extended to test client DataSources

Patch ' d435-10.1-enable-checkDataSource30.diff' which enables the test checkDataSource30.java to run with client in 10.1 branch. This patch is for 10.1 branch. Patch does following:

* Modifies checkDataSource30.java and updates master file

* Removes jdbcapi/checkDataSource30.java from DerbyNetClient.exclude
 
With this patch, I ran derbynetclientmats suite. I also ran jdbcapi/checkDataSource30.java in embedded framework. No failures. Tests run with Sun jdk1.4.2 on Windows XP.

Merge from trunk by Deepa Remesh




Modified:
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDataSource30.out
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClient.exclude
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDataSource30.out
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDataSource30.out?rev=412259&r1=412258&r2=412259&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDataSource30.out (original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDataSource30.out Tue Jun  6 19:45:54 2006
@@ -208,7 +208,7 @@
 EVENT(5):connectionClosed
 Running JDBC 3.0 connection checks on Global XADataSource
   holdability     false
-JDBC 3.0 savepoint SQL Exception: Cannot rollback a global transaction using the Connection, commit processing must go thru XAResource interface.
+JDBC 3.0 savepoint org.apache.derby.client.am.SqlException: Cannot set savepoint when in auto-commit mode.
 Running connection checks on Global XADataSource
   isolation level 2
   auto commit     false
@@ -226,7 +226,7 @@
 Global XADataSource <closedstmt>.execute() null - Invalid operation: statement closed
 Running JDBC 3.0 connection checks on Global XADataSource
   holdability     false
-JDBC 3.0 savepoint SQL Exception: Cannot rollback a global transaction using the Connection, commit processing must go thru XAResource interface.
+JDBC 3.0 savepoint org.apache.derby.client.am.SqlException: Cannot set savepoint when in auto-commit mode.
 Running connection checks on Global XADataSource
   isolation level 2
   auto commit     false
@@ -282,7 +282,7 @@
 Switch to local XADataSource <closedstmt>.execute() null - Invalid operation: statement closed
 Running JDBC 3.0 connection checks on Switch to global XADataSource
   holdability     false
-JDBC 3.0 savepoint SQL Exception: Cannot rollback a global transaction using the Connection, commit processing must go thru XAResource interface.
+JDBC 3.0 savepoint org.apache.derby.client.am.SqlException: Cannot set savepoint when in auto-commit mode.
 Running connection checks on Switch to global XADataSource
   isolation level 2
   auto commit     false
@@ -301,7 +301,7 @@
 Switch to global XADataSource <closedstmt>.execute() null - Invalid operation: statement closed
 Running JDBC 3.0 connection checks on Switch to global XADataSource
   holdability     false
-JDBC 3.0 savepoint SQL Exception: Cannot rollback a global transaction using the Connection, commit processing must go thru XAResource interface.
+JDBC 3.0 savepoint org.apache.derby.client.am.SqlException: Cannot set savepoint when in auto-commit mode.
 Running connection checks on Switch to global XADataSource
   isolation level 2
   auto commit     false
@@ -547,7 +547,7 @@
   getFetchSize() 444
   getMaxFieldSize() 713
   getMaxRows() 19
-  getResultSetHoldability() CLOSE_CURSORS_AT_COMMIT 
+  getResultSetHoldability() HOLD_CURSORS_OVER_COMMIT 
 Statement State @ PS GLOBAL 
   getResultSetType() SCROLL_INSENSITIVE
   getResultSetConcurrency() READ_ONLY
@@ -555,7 +555,7 @@
   getFetchSize() 888
   getMaxFieldSize() 317
   getMaxRows() 91
-  getResultSetHoldability() CLOSE_CURSORS_AT_COMMIT 
+  getResultSetHoldability() HOLD_CURSORS_OVER_COMMIT 
   Parameter Count 1
     1 type 4
 Statement State @ CS GLOBAL 
@@ -565,7 +565,7 @@
   getFetchSize() 999
   getMaxFieldSize() 137
   getMaxRows() 85
-  getResultSetHoldability() CLOSE_CURSORS_AT_COMMIT 
+  getResultSetHoldability() HOLD_CURSORS_OVER_COMMIT 
   Parameter Count 2
     1 type 12
     2 type 12
@@ -610,9 +610,12 @@
   xid row 0 lock count 14
   xid row 1 lock count 14
 END LOCK TABLE
-sru1-local-8: ru(SN1) contents {1} {2} {3}
-sru2-local-9: ru(OAK2) contents {1} {2} {3}
-sru3-local-10: ru(SF3) contents {1} {2} {3}
+sru1-local-8: mismatched Statement connection
+sru1-local-8: ru(SQL_CURLH000C) contents {1} {2} {3}
+sru2-local-9: mismatched Statement connection
+sru2-local-9: ru(SQL_CURLN000C) contents {1} {2} {3}
+sru3-local-10: mismatched Statement connection
+sru3-local-10: ru(SQL_CURLH000C) contents {1} {2} {3}
 Statement State @ LOCAL 2 
   getResultSetType() SCROLL_INSENSITIVE
   getResultSetConcurrency() READ_ONLY
@@ -651,12 +654,19 @@
 sruBatch: ru(SQL_CURLH000C) contents {1} {2} {3} {4} {5} {6} {7} {8}
 XAConnection.getConnection : getConnection() is not valid on a closed PooledConnection.
 XAResource.start : XAException - XAER_RMFAIL : Connection is Closed.
+ERROR (no SQLState): Connection is Closed.
 XAResource.end : XAException - XAER_RMFAIL : Connection is Closed.
+ERROR (no SQLState): Connection is Closed.
 XAResource.commit : XAException - XAER_RMFAIL : Connection is Closed.
+ERROR (no SQLState): Connection is Closed.
 XAResource.prepare : XAException - XAER_RMFAIL : Connection is Closed.
+ERROR (no SQLState): Connection is Closed.
 XAResource.recover : XAException - XAER_RMFAIL : Connection is Closed.
+ERROR (no SQLState): Connection is Closed.
 XAResource.prepare : XAException - XAER_RMFAIL : Connection is Closed.
+ERROR (no SQLState): Connection is Closed.
 XAResource.isSameRM : XAException - XAER_RMFAIL : Connection is Closed.
+ERROR (no SQLState): Connection is Closed.
 Patricio update count 1
 conn4 autcommit true
 acxs 1
@@ -665,6 +675,7 @@
 acxs 1
 acxs 2
 autocommitxastart expected  : XAException - XAER_OUTSIDE : Error executing a XAResource.start(), Server returned XAER_OUTSIDE
+ERROR (no SQLState): Error executing a XAResource.start(), Server returned XAER_OUTSIDE
 Expected XA error code: -9
 acxs 3
 testing jira 95 for DataSource; ok - expected exception: XCY00
@@ -689,28 +700,27 @@
 H@3 id 3
 CONNECTION(xa) HOLDABILITY false
 STATEMENT(this one was created with holdability false, outside the global transaction. Check it's holdability inside global transaction) HOLDABILITY false
-STATEMENT(this one was created with holdability true, outside the global transaction. Check it's holdability inside global transaction) HOLDABILITY false
+STATEMENT(this one was created with holdability true, outside the global transaction. Check it's holdability inside global transaction) HOLDABILITY true
 STATEMENT(this one was created with default holdability inside this global transaction. Check it's holdability) HOLDABILITY false
 PREPAREDSTATEMENT(this one was created with default holdability inside this global transaction. Check it's holdability) HOLDABILITY false
 CALLABLESTATEMENT(this one was created with default holdability inside this global transaction. Check it's holdability) HOLDABILITY false
 X@1 id 1
 X@2 id 2
-Expected SQLException No current connection.
-Expected SQLException No current connection.
+Expected SQLException No current connection. : 
+Expected SQLException Invalid operation: result set closed
 resume XA transaction and keep using rs
 Check holdability of various jdbc objects after resuming XA transaction
 CONNECTION(xa) HOLDABILITY false
 STATEMENT(this one was created with holdability false, outside the global transaction. Check it's holdability inside global transaction) HOLDABILITY false
-STATEMENT(this one was created with holdability true, outside the global transaction. Check it's holdability inside global transaction) HOLDABILITY false
+STATEMENT(this one was created with holdability true, outside the global transaction. Check it's holdability inside global transaction) HOLDABILITY true
 STATEMENT(this one was created with default holdability inside the global transaction when it was first started. Check it's holdability) HOLDABILITY false
 PREPAREDSTATEMENT(this one was created with default holdability inside the global transaction when it was first started. Check it's holdability) HOLDABILITY false
 CALLABLESTATEMENT(this one was created with default holdability inside the global transaction when it was first started. Check it's holdability) HOLDABILITY false
 STATEMENT(this one was created with default holdability after the global transaction was resumed. Check it's holdability) HOLDABILITY false
 PREPAREDSTATEMENT(this one was created with default holdability after the global transaction was resumed. Check it's holdability) HOLDABILITY false
 CALLABLESTATEMENT(this one was created with default holdability after the global transaction was resumed. Check it's holdability) HOLDABILITY false
-X@3 id 3
-Expected SQLException ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
-Expected SQLException ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
+Expected SQLException Invalid operation: result set closed
+Expected SQLException Invalid operation: result set closed
 Set connection to hold 
 CONNECTION(held) HOLDABILITY true
 CONNECTION(xa) HOLDABILITY false
@@ -718,9 +728,6 @@
 HOLDABLE Statement in global xact false connection warning ResultSetHoldability restricted to ResultSet.CLOSE_CURSORS_AT_COMMIT for a global transaction.
 HOLDABLE PreparedStatement in global xact false connection warning ResultSetHoldability restricted to ResultSet.CLOSE_CURSORS_AT_COMMIT for a global transaction.
 HOLDABLE CallableStatement in global xact false connection warning ResultSetHoldability restricted to ResultSet.CLOSE_CURSORS_AT_COMMIT for a global transaction.
-STATEMENT HOLDABILITY false
-PREPARED STATEMENT HOLDABILITY false
-CALLABLE STATEMENT HOLDABILITY false
 CONNECTION(held) HOLDABILITY true
 PASS XA HOLDABILITY TEST
 **Test holdability state for: PooledConnection **

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClient.exclude
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClient.exclude?rev=412259&r1=412258&r2=412259&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClient.exclude (original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClient.exclude Tue Jun  6 19:45:54 2006
@@ -14,5 +14,4 @@
 jdbcapi/statementJdbc20.java
 jdbcapi/testRelative.java
 jdbcapi/resultsetJdbc30.java
-jdbcapi/checkDataSource30.java
 jdbcapi/statementJdbc30.java

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java?rev=412259&r1=412258&r2=412259&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java (original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java Tue Jun  6 19:45:54 2006
@@ -51,11 +51,16 @@
 public class checkDataSource30 extends checkDataSource
 { 
 
+    // DERBY-1370 - Embedded and client driver differ in the holdability 
+	// reported inside a global transaction for statements that were created
+	// with HOLD_CURSORS_OVER_COMMIT outside the transaction
+	// It looks like embedded behaviour is correct.
+	private static boolean stmtHoldabilityError = 
+							TestUtil.isDerbyNetClientFramework();
+	
 	public static void main(String[] args) throws Exception {
 
 		checkDataSource30 tester = new checkDataSource30();
-
-
 		tester.runTest(args);
 		tester.checkXAHoldability();
 		
@@ -231,6 +236,7 @@
 			System.out.println("CALLABLESTATEMENT(this one was created with default holdability inside this global transaction. Check it's holdability) HOLDABILITY " + (callablestmtInsideGlobalTransaction.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
 
 			ResultSet rsx = s.executeQuery("select id from hold_30 for update");
+			 
 			rsx.next(); System.out.println("X@1 id " + rsx.getInt(1));
 			rsx.next(); System.out.println("X@2 id " + rsx.getInt(1));
 			xr.end(xid, XAResource.TMSUCCESS);
@@ -266,7 +272,12 @@
 			System.out.println("STATEMENT(this one was created with default holdability after the global transaction was resumed. Check it's holdability) HOLDABILITY " + (stmtAfterGlobalTransactionResume.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
 			System.out.println("PREPAREDSTATEMENT(this one was created with default holdability after the global transaction was resumed. Check it's holdability) HOLDABILITY " + (prepstmtAfterGlobalTransactionResume.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
 			System.out.println("CALLABLESTATEMENT(this one was created with default holdability after the global transaction was resumed. Check it's holdability) HOLDABILITY " + (callablestmtAfterGlobalTransactionResume.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
-			rsx.next(); System.out.println("X@3 id " + rsx.getInt(1));
+		    // DERBY-1370			
+			if (! stmtHoldabilityError)
+			{
+				// Network XA BUG gives result set closed
+				rsx.next(); System.out.println("X@3 id " + rsx.getInt(1));
+			}
 			xr.end(xid, XAResource.TMSUCCESS);
 
 
@@ -279,7 +290,6 @@
 			} catch (SQLException sqle) {
 				System.out.println("Expected SQLException " + sqle.getMessage());
 			}
-
 			try {
 				rsh.next(); System.out.println("FAIL - rsh's should be closed (B) " + rsx.getInt(1));
 			} catch (SQLException sqle) {
@@ -328,23 +338,26 @@
            shxa.close();
            
            
-			// check we can use a holdable statement set up in local mode.
-            // holdability is downgraded, tested in XATest.java
-			System.out.println("STATEMENT HOLDABILITY " + (sh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
-			sh.executeQuery("select id from hold_30").close();
-			sh.execute("select id from hold_30");
-            sh.getResultSet().close();
-
-            System.out.println("PREPARED STATEMENT HOLDABILITY " + (psh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
-			psh.executeQuery().close();
-			psh.execute();
-            psh.getResultSet().close();
-
-			System.out.println("CALLABLE STATEMENT HOLDABILITY " + (csh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
-			csh.executeQuery().close();
-			csh.execute();
-            csh.getResultSet().close();
-
+		   // check we can use a holdable statement set up in local mode.
+           // holdability is downgraded, tested in XATest.java
+  	       // DERBY-1370           
+           if(! stmtHoldabilityError) {
+           		System.out.println("STATEMENT HOLDABILITY " + (sh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+				sh.executeQuery("select id from hold_30").close();
+				sh.execute("select id from hold_30");
+	            sh.getResultSet().close();
+	
+	            System.out.println("PREPARED STATEMENT HOLDABILITY " + (psh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+				psh.executeQuery().close();
+				psh.execute();
+	            psh.getResultSet().close();
+	
+				System.out.println("CALLABLE STATEMENT HOLDABILITY " + (csh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+				csh.executeQuery().close();
+				csh.execute();
+	            csh.getResultSet().close();
+           }    	
+	            
 			// but an update works
 			sh.executeUpdate("insert into hold_30 values(10, 'init10')");