db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r380020 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master/DerbyNetClient/checkDataSource.out tests/jdbcapi/checkDataSource.java
Date Thu, 23 Feb 2006 01:48:08 GMT
Author: kmarsden
Date: Wed Feb 22 17:48:07 2006
New Revision: 380020

URL: http://svn.apache.org/viewcvs?rev=380020&view=rev
Log:
Disable tests for setting isolation with an SQL statement for client until DERBY-1035 is fixed


Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDataSource.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDataSource.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDataSource.out?rev=380020&r1=380019&r2=380020&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDataSource.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDataSource.out
Wed Feb 22 17:48:07 2006
@@ -334,61 +334,6 @@
   isolation level READ_UNCOMMITTED
   auto commit     true
   read only       false
-Issue SQL to change isolation in local transaction
-SQL to change isolation in local
-  isolation level READ_UNCOMMITTED
-  auto commit     true
-  read only       false
-1st global(new)
-  isolation level READ_UNCOMMITTED
-  auto commit     false
-  read only       false
-local
-  isolation level READ_UNCOMMITTED
-  auto commit     true
-  read only       false
-Issue SQL to change isolation in local transaction
-SQL to change isolation in local
-  isolation level READ_UNCOMMITTED
-  auto commit     true
-  read only       false
-2nd global(new)
-  isolation level READ_UNCOMMITTED
-  auto commit     false
-  read only       false
-1st global(existing)
-  isolation level READ_UNCOMMITTED
-  auto commit     false
-  read only       false
-local
-  isolation level READ_UNCOMMITTED
-  auto commit     true
-  read only       false
-1st global(existing)
-  isolation level READ_UNCOMMITTED
-  auto commit     false
-  read only       false
-Issue SQL to change isolation in 1st global transaction
-change isolation of existing 1st global transaction
-  isolation level READ_UNCOMMITTED
-  auto commit     false
-  read only       false
-local
-  isolation level READ_UNCOMMITTED
-  auto commit     true
-  read only       false
-2nd global(existing)
-  isolation level READ_UNCOMMITTED
-  auto commit     false
-  read only       false
-(After 2nd global rollback) local
-  isolation level READ_UNCOMMITTED
-  auto commit     true
-  read only       false
-(After 1st global rollback) local
-  isolation level READ_UNCOMMITTED
-  auto commit     true
-  read only       false
 TESTING RE_USE OF STATEMENT OBJECTS
 THE STATEMENT OBJECTS CAN NOT BE REUSED ACROSS LOCAL/GLOBAL CONNECTIONS BECAUSE, LOCAL CONNECTION
CREATES THEM
 WITH HOLDABILITY TRUE WHEREAS GLOBAL CONNECTION CAN ONLY WORK WITH STATEMENTS WITH HOLDABILITY
FALSE

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource.java?rev=380020&r1=380019&r2=380020&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource.java
Wed Feb 22 17:48:07 2006
@@ -81,7 +81,13 @@
 	// This has been filed as DERBY-1004 
 	private static boolean needRollbackBeforePCGetConnection = 
 		TestUtil.isDerbyNetClientFramework(); 
-		
+	
+	// DERBY-1035 With client, Connection.getTransactionIsolation() return value is 
+	// wrong after changing the isolation level with an SQL statement such as 
+	// "set current isolation = RS"
+	// Tests for setting isolation level this way only run in embedded for now.
+	private static boolean canSetIsolationWithStatement = TestUtil.isEmbeddedFramework();
+	  
     /**
      * A hashtable of opened connections.  This is used when checking to
      * make sure connection strings are unique; we need to make sure all
@@ -110,7 +116,8 @@
 	 * test and lose the information it has collected.
 	 */
 	private final Object nogc = SecurityCheck.class;
-  
+
+	
 	
 	public static void main(String[] args) throws Exception {
 
@@ -427,49 +434,8 @@
 		cs1.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
 		printState("setTransactionIsolation in local", cs1);
 
-    System.out.println("Issue SQL to change isolation in local transaction");
-		s.executeUpdate("set current isolation = RR");
-		printState("SQL to change isolation in local", cs1);
-
-		xid = new cdsXid(1, (byte) 35, (byte) 47);
-		xar.start(xid, XAResource.TMNOFLAGS);
-		printState("1st global(new)", cs1);
-		xar.end(xid, XAResource.TMSUCCESS);
-
-		printState("local", cs1);
-    System.out.println("Issue SQL to change isolation in local transaction");
-		s.executeUpdate("set current isolation = RS");
-		printState("SQL to change isolation in local", cs1);
-
-		Xid xid2 = new cdsXid(1, (byte) 93, (byte) 103);
-		xar.start(xid2, XAResource.TMNOFLAGS);
-		printState("2nd global(new)", cs1);
-		xar.end(xid2, XAResource.TMSUCCESS);
-
-		xar.start(xid, XAResource.TMJOIN);
-		printState("1st global(existing)", cs1);
-		xar.end(xid, XAResource.TMSUCCESS);
-
-		printState("local", cs1);
-
-		xar.start(xid, XAResource.TMJOIN);
-		printState("1st global(existing)", cs1);
-    System.out.println("Issue SQL to change isolation in 1st global transaction");
-		s.executeUpdate("set current isolation = UR");
-		printState("change isolation of existing 1st global transaction", cs1);
-		xar.end(xid, XAResource.TMSUCCESS);
-
-		printState("local", cs1);
-
-		xar.start(xid2, XAResource.TMJOIN);
-		printState("2nd global(existing)", cs1);
-		xar.end(xid2, XAResource.TMSUCCESS);
-
-		xar.rollback(xid2);
-		printState("(After 2nd global rollback) local", cs1);
-
-		xar.rollback(xid);
-		printState("(After 1st global rollback) local", cs1);
+		if (canSetIsolationWithStatement)
+			testSetIsolationWithStatement(s, xar, cs1);
 
 		// now check re-use of *Statement objects across local/global connections.
 		System.out.println("TESTING RE_USE OF STATEMENT OBJECTS");
@@ -723,6 +689,60 @@
 		}
 
 		testDSRequestAuthentication();
+	}
+
+	/**
+	 * @param s
+	 * @param xar
+	 * @param conn
+	 * @throws SQLException
+	 * @throws XAException
+	 */
+	private void testSetIsolationWithStatement(Statement s, XAResource xar, Connection conn)
throws SQLException, XAException {
+		Xid xid;
+		System.out.println("Issue SQL to change isolation in local transaction");
+			s.executeUpdate("set current isolation = RR");
+			printState("SQL to change isolation in local", conn);
+
+			xid = new cdsXid(1, (byte) 35, (byte) 47);
+			xar.start(xid, XAResource.TMNOFLAGS);
+			printState("1st global(new)", conn);
+			xar.end(xid, XAResource.TMSUCCESS);
+
+			printState("local", conn);
+		System.out.println("Issue SQL to change isolation in local transaction");
+			s.executeUpdate("set current isolation = RS");
+			printState("SQL to change isolation in local", conn);
+
+			Xid xid2 = new cdsXid(1, (byte) 93, (byte) 103);
+			xar.start(xid2, XAResource.TMNOFLAGS);
+			printState("2nd global(new)", conn);
+			xar.end(xid2, XAResource.TMSUCCESS);
+
+			xar.start(xid, XAResource.TMJOIN);
+			printState("1st global(existing)", conn);
+			xar.end(xid, XAResource.TMSUCCESS);
+
+			printState("local", conn);
+
+			xar.start(xid, XAResource.TMJOIN);
+			printState("1st global(existing)", conn);
+		System.out.println("Issue SQL to change isolation in 1st global transaction");
+			s.executeUpdate("set current isolation = UR");
+			printState("change isolation of existing 1st global transaction", conn);
+			xar.end(xid, XAResource.TMSUCCESS);
+
+			printState("local", conn);
+
+			xar.start(xid2, XAResource.TMJOIN);
+			printState("2nd global(existing)", conn);
+			xar.end(xid2, XAResource.TMSUCCESS);
+
+			xar.rollback(xid2);
+			printState("(After 2nd global rollback) local", conn);
+
+			xar.rollback(xid);
+			printState("(After 1st global rollback) local", conn);
 	}
 
 	protected void showXAException(String tag, XAException xae) {



Mime
View raw message