db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davi...@apache.org
Subject svn commit: r378045 [1/2] - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/sql/execute/ testing/org/apache/derbyTesting/functionTests/harness/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTes...
Date Wed, 15 Feb 2006 18:18:51 GMT
Author: davidvc
Date: Wed Feb 15 10:18:47 2006
New Revision: 378045

URL: http://svn.apache.org/viewcvs?rev=378045&view=rev
Log:
DERBY-918: Introduce new "junit" test type

DERBY-934: Create a set of JUnit tests for scrollable updatable cursors.  I
also added these tests to the jdbcapi and derbynetclientmats suites (except
for ConcurrencyTest, which takes too long to run currently)

DERBY-797: After calling ResultSet.relative(0) the cursor loses its position

These are all submitted together because of interdependencies.

All contributed by Andreas Kornelliusen

NOTE: This may cause test failures on the IBM JDK; I did not test it with
this JDK, nor did I exclude these tests from running on this JDK, as I 
couldn't say whether they work or not (I don't have the IBM JDK).

I did exclude running these tests on DerbyNet, because they have a hard
failure saying "null user not supported."

Ran these tests on JDK 1.4, JDK 1.3, with both embedded and network
client drivers.  Note that the SURTest.out has failures; this is because
(a) the scrollable updatable result set work is not yet finished and
(b) there are differences between network client and embedded client which
need to be resolved.

--------

DERBY-797 files:
M    java/engine/org/apache/derby/impl/sql/execute/ScrollInsensitiveResultSet.java

DERBY-918 files:
M    java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java
M    java/testing/org/apache/derbyTesting/functionTests/harness/testtypes.properties
M    java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java

DERBY-934 files:
AM   java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest_app.properties
AM   java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURBaseTest.java
AM   java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest.java
AM   java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest_app.properties
AM   java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest.java
AM   java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURDataModelSetup.java
AM   java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURTest.java
AM   java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURTest_app.properties
A    java/testing/org/apache/derbyTesting/functionTests/master/SURTest.out
A    java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/SURTest.out
M    java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall
M    java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.runall
M    java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNet.exclude


Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/SURTest.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/SURTest.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest.java   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest_app.properties   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURBaseTest.java   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURDataModelSetup.java   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest.java   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest_app.properties   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURTest.java   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURTest_app.properties   (with props)
Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ScrollInsensitiveResultSet.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/testtypes.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNet.exclude
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.runall
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ScrollInsensitiveResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ScrollInsensitiveResultSet.java?rev=378045&r1=378044&r2=378045&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ScrollInsensitiveResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ScrollInsensitiveResultSet.java Wed Feb 15 10:18:47 2006
@@ -334,8 +334,7 @@
 		// Return the current row for 0
 		if (row == 0)
 		{
-                    if ((beforeFirst || afterLast) ||
-                        (!beforeFirst && !afterLast)) {
+                    if (beforeFirst || afterLast || currentPosition==0) {
                         return null;
                     } else {
 			return getRowFromHashTable(currentPosition);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java?rev=378045&r1=378044&r2=378045&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java Wed Feb 15 10:18:47 2006
@@ -472,7 +472,7 @@
         int index = scriptName.lastIndexOf('/');
         if (index == -1) // no test directory was specified
         {
-            if ( (!testType.equals("sql")) && (!testType.equals("java")) )
+            if ( (!testType.equals("sql")) && (!testType.equals("java")) && (!testType.equals("junit")))
             {
                 System.out.println("Test argument should be of the form: <dir>/<test>.<ext>");
                 System.exit(1);
@@ -502,7 +502,7 @@
         // Get the test name without the extension
         testBase = scriptFileName.substring(0, scriptFileName.lastIndexOf("."+testType));
 
-		if (testType.equals("java"))
+		if (testType.equals("java") || testType.equals("junit"))
 		{
                     //get the javaPath
 		    String tmp = defaultPackageName.replace('/', '.');
@@ -621,7 +621,8 @@
 
         // For certain test types, locate script file based on scriptName
         // Then determine the actual test name and directory
-        if ( (!testType.equals("java")) && 
+        if ( (!testType.equals("java")) &&
+             (!testType.equals("junit")) &&
              (!testType.equals("unit")) && 
              (!testType.equals("multi")) ) 
         {
@@ -1527,7 +1528,6 @@
 	                    jvmflags = "";
 	            }
 	        }
-	        
 	        if (NetServer.isJCCConnection(framework)
 	        		|| "true".equalsIgnoreCase(ap.getProperty("noSecurityManager")))
 	        	runWithoutSecurityManager = true;
@@ -2135,6 +2135,15 @@
             v.addElement("-p");
             v.addElement(propString);
         }
+        else if (testType.equals("junit"))
+        {
+            v.addElement("junit.textui.TestRunner");
+            if (javaPath.length() > 0) {
+                v.addElement(javaPath + "." + testBase);
+            } else {
+                v.addElement(testBase);
+            }
+        }
         else if ( testType.equals("multi") )
         {
 	System.out.println("scriptiflename is: " + scriptFileName);
@@ -2405,7 +2414,11 @@
             org.apache.derbyTesting.unitTests.harness.UnitTestMain.main(args);
             */
         }
-        
+        else if (testType.equals("junit"))
+        {
+            System.out.println("JUnit tests not implemented yet with useprocess=false");
+            System.exit(1);
+        }        
         ps.close();
          if (installedSecurityManager)
         {

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/testtypes.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/testtypes.properties?rev=378045&r1=378044&r2=378045&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/testtypes.properties (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/testtypes.properties Wed Feb 15 10:18:47 2006
@@ -1 +1 @@
-testtypes=sql,sql2,unit,java,multi,demo
+testtypes=sql,sql2,unit,java,multi,demo,junit

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/SURTest.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/SURTest.out?rev=378045&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/SURTest.out (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/SURTest.out Wed Feb 15 10:18:47 2006
@@ -0,0 +1,220 @@
+.F.F....F.F.F.F.F...E.E.E.E.E.E.E.E......java.sql.SQLException: invalid operation: connection closed
+Caused by: org.apache.derby.client.am.SqlException: invalid operation: connection closed
+	... 17 more
+E.E.F.E.E.E.E.F.F....F.F.F.
+F.F...E.E.E.E.E.E.E.E......java.sql.SQLException: invalid operation: connection closed
+Caused by: org.apache.derby.client.am.SqlException: invalid operation: connection closed
+	... 17 more
+E.E.F.E.E.E.E.F.F....F.F.F.F.F...E.E.E.E.E.
+E.E.E......java.sql.SQLException: invalid operation: connection closed
+Caused by: org.apache.derby.client.am.SqlException: invalid operation: connection closed
+	... 17 more
+E.E.F.E.E.E.E.F.F....F.F.F.F.F...E.E.E.E.E.E.E.E......java.sql.SQLException: invalid operation: connection closed
+Caused by: org.apache.derby.client.am.SqlException: invalid operation: connection closed
+	... 17 more
+E.
+E.F.E.E.E.E
+There were 56 errors:
+1) testIndexedScrollInsensitiveUpdateCursorWithoutForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 23 more
+2) testIndexedScrollInsensitiveUpdateCursorWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 23 more
+3) testPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+4) testOtherPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+5) testOtherAndOwnPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+6) testMultipleKeyUpdates(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+7) testSecondaryIndexKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+8) testOtherSecondaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+9) testScrollablePositionedUpdateWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: Execution failed due to a distribution protocol error that caused deallocation of the conversation.  A PROTOCOL Data Stream Syntax Error was detected.  Reason: 0x3
+Caused by: org.apache.derby.client.am.DisconnectException: Execution failed due to a distribution protocol error that caused deallocation of the conversation.  A PROTOCOL Data Stream Syntax Error was detected.  Reason: 0x3
+	... 22 more
+10) testScrollInsensitiveConcurUpdatableWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 24 more
+11) testScrollInsensitiveConcurUpdatableWithForUpdate3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 23 more
+12) testScrollInsensitiveConcurUpdatableWithoutForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 24 more
+13) testScrollInsensitiveConcurUpdatableWithoutForUpdate2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 24 more
+14) testScrollInsensitiveConcurUpdatableWithoutForUpdate3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 23 more
+15) testIndexedScrollInsensitiveUpdateCursorWithoutForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 23 more
+16) testIndexedScrollInsensitiveUpdateCursorWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 23 more
+17) testPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+18) testOtherPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+19) testOtherAndOwnPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+20) testMultipleKeyUpdates(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+21) testSecondaryIndexKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+22) testOtherSecondaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+23) testScrollablePositionedUpdateWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: Execution failed due to a distribution protocol error that caused deallocation of the conversation.  A PROTOCOL Data Stream Syntax Error was detected.  Reason: 0x3
+Caused by: org.apache.derby.client.am.DisconnectException: Execution failed due to a distribution protocol error that caused deallocation of the conversation.  A PROTOCOL Data Stream Syntax Error was detected.  Reason: 0x3
+	... 22 more
+24) testScrollInsensitiveConcurUpdatableWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 24 more
+25) testScrollInsensitiveConcurUpdatableWithForUpdate3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 23 more
+26) testScrollInsensitiveConcurUpdatableWithoutForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 24 more
+27) testScrollInsensitiveConcurUpdatableWithoutForUpdate2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 24 more
+28) testScrollInsensitiveConcurUpdatableWithoutForUpdate3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 23 more
+29) testIndexedScrollInsensitiveUpdateCursorWithoutForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 23 more
+30) testIndexedScrollInsensitiveUpdateCursorWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 23 more
+31) testPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+32) testOtherPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+33) testOtherAndOwnPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+34) testMultipleKeyUpdates(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+35) testSecondaryIndexKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+36) testOtherSecondaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+37) testScrollablePositionedUpdateWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: Execution failed due to a distribution protocol error that caused deallocation of the conversation.  A PROTOCOL Data Stream Syntax Error was detected.  Reason: 0x3
+Caused by: org.apache.derby.client.am.DisconnectException: Execution failed due to a distribution protocol error that caused deallocation of the conversation.  A PROTOCOL Data Stream Syntax Error was detected.  Reason: 0x3
+	... 22 more
+38) testScrollInsensitiveConcurUpdatableWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 24 more
+39) testScrollInsensitiveConcurUpdatableWithForUpdate3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 23 more
+40) testScrollInsensitiveConcurUpdatableWithoutForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 24 more
+41) testScrollInsensitiveConcurUpdatableWithoutForUpdate2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 24 more
+42) testScrollInsensitiveConcurUpdatableWithoutForUpdate3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 23 more
+43) testIndexedScrollInsensitiveUpdateCursorWithoutForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 23 more
+44) testIndexedScrollInsensitiveUpdateCursorWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 23 more
+45) testPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+46) testOtherPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+47) testOtherAndOwnPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+48) testMultipleKeyUpdates(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+49) testSecondaryIndexKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+50) testOtherSecondaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 22 more
+51) testScrollablePositionedUpdateWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: Execution failed due to a distribution protocol error that caused deallocation of the conversation.  A PROTOCOL Data Stream Syntax Error was detected.  Reason: 0x3
+Caused by: org.apache.derby.client.am.DisconnectException: Execution failed due to a distribution protocol error that caused deallocation of the conversation.  A PROTOCOL Data Stream Syntax Error was detected.  Reason: 0x3
+	... 22 more
+52) testScrollInsensitiveConcurUpdatableWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 24 more
+53) testScrollInsensitiveConcurUpdatableWithForUpdate3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 23 more
+54) testScrollInsensitiveConcurUpdatableWithoutForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 24 more
+55) testScrollInsensitiveConcurUpdatableWithoutForUpdate2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 24 more
+56) testScrollInsensitiveConcurUpdatableWithoutForUpdate3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)java.sql.SQLException: ResultSet is not updatable.
+Caused by: org.apache.derby.client.am.SqlException: ResultSet is not updatable.
+	... 23 more
+There were 32 failures:
+1) testConcurrencyModeWarning1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Expected to get a warning
+2) testConcurrencyModeWarning2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Expected to get a warning
+3) testFailOnUpdateOfReadOnlyResultSet1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+4) testFailOnUpdateOfReadOnlyResultSet2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+5) testFailOnUpdateOfReadOnlyResultSet3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+6) testFailOnUpdateOfReadOnlyResultSet4(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+7) testFailOnUpdateOfReadOnlyResultSet5(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+8) testScrollInsensitiveConcurUpdatableWithForUpdate2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Invalid resultset concurrency on statement expected:<1008> but was:<1007>
+9) testConcurrencyModeWarning1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Expected to get a warning
+10) testConcurrencyModeWarning2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Expected to get a warning
+11) testFailOnUpdateOfReadOnlyResultSet1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+12) testFailOnUpdateOfReadOnlyResultSet2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+13) testFailOnUpdateOfReadOnlyResultSet3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+14) testFailOnUpdateOfReadOnlyResultSet4(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+15) testFailOnUpdateOfReadOnlyResultSet5(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+16) testScrollInsensitiveConcurUpdatableWithForUpdate2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Invalid resultset concurrency on statement expected:<1008> but was:<1007>
+17) testConcurrencyModeWarning1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Expected to get a warning
+18) testConcurrencyModeWarning2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Expected to get a warning
+19) testFailOnUpdateOfReadOnlyResultSet1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+20) testFailOnUpdateOfReadOnlyResultSet2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+21) testFailOnUpdateOfReadOnlyResultSet3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+22) testFailOnUpdateOfReadOnlyResultSet4(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+23) testFailOnUpdateOfReadOnlyResultSet5(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+24) testScrollInsensitiveConcurUpdatableWithForUpdate2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Invalid resultset concurrency on statement expected:<1008> but was:<1007>
+25) testConcurrencyModeWarning1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Expected to get a warning
+26) testConcurrencyModeWarning2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Expected to get a warning
+27) testFailOnUpdateOfReadOnlyResultSet1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+28) testFailOnUpdateOfReadOnlyResultSet2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+29) testFailOnUpdateOfReadOnlyResultSet3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+30) testFailOnUpdateOfReadOnlyResultSet4(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+31) testFailOnUpdateOfReadOnlyResultSet5(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.ComparisonFailure: Unexpected SQL state expected:<XJ083> but was:<null>
+32) testScrollInsensitiveConcurUpdatableWithForUpdate2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Invalid resultset concurrency on statement expected:<1008> but was:<1007>
+FAILURES!!!
+Tests run: 128,  Failures: 32,  Errors: 56

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/SURTest.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/SURTest.out?rev=378045&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/SURTest.out (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/SURTest.out Wed Feb 15 10:18:47 2006
@@ -0,0 +1,68 @@
+.............E.E.E.E.E.E.E.E......F.E.F.E.E.E.E.........
+....E.E.E.E.E.E.E.E......F.E.F.E.E.E.E.............E.E.E.E.E.
+E.E.E......F.E.F.E.E.E.E.............E.E.E.E.E.E.E.E......F.
+E.F.E.E.E.E
+There were 52 errors:
+1) testIndexedScrollInsensitiveUpdateCursorWithoutForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+2) testIndexedScrollInsensitiveUpdateCursorWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+3) testPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+4) testOtherPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+5) testOtherAndOwnPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+6) testMultipleKeyUpdates(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+7) testSecondaryIndexKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+8) testOtherSecondaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+9) testScrollInsensitiveConcurUpdatableWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+10) testScrollInsensitiveConcurUpdatableWithForUpdate3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+11) testScrollInsensitiveConcurUpdatableWithoutForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+12) testScrollInsensitiveConcurUpdatableWithoutForUpdate2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+13) testScrollInsensitiveConcurUpdatableWithoutForUpdate3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+14) testIndexedScrollInsensitiveUpdateCursorWithoutForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+15) testIndexedScrollInsensitiveUpdateCursorWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+16) testPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+17) testOtherPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+18) testOtherAndOwnPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+19) testMultipleKeyUpdates(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+20) testSecondaryIndexKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+21) testOtherSecondaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+22) testScrollInsensitiveConcurUpdatableWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+23) testScrollInsensitiveConcurUpdatableWithForUpdate3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+24) testScrollInsensitiveConcurUpdatableWithoutForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+25) testScrollInsensitiveConcurUpdatableWithoutForUpdate2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+26) testScrollInsensitiveConcurUpdatableWithoutForUpdate3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+27) testIndexedScrollInsensitiveUpdateCursorWithoutForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+28) testIndexedScrollInsensitiveUpdateCursorWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+29) testPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+30) testOtherPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+31) testOtherAndOwnPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+32) testMultipleKeyUpdates(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+33) testSecondaryIndexKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+34) testOtherSecondaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+35) testScrollInsensitiveConcurUpdatableWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+36) testScrollInsensitiveConcurUpdatableWithForUpdate3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+37) testScrollInsensitiveConcurUpdatableWithoutForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+38) testScrollInsensitiveConcurUpdatableWithoutForUpdate2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+39) testScrollInsensitiveConcurUpdatableWithoutForUpdate3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+40) testIndexedScrollInsensitiveUpdateCursorWithoutForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+41) testIndexedScrollInsensitiveUpdateCursorWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+42) testPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+43) testOtherPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+44) testOtherAndOwnPrimaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+45) testMultipleKeyUpdates(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+46) testSecondaryIndexKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+47) testOtherSecondaryKeyUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+48) testScrollInsensitiveConcurUpdatableWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+49) testScrollInsensitiveConcurUpdatableWithForUpdate3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+50) testScrollInsensitiveConcurUpdatableWithoutForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+51) testScrollInsensitiveConcurUpdatableWithoutForUpdate2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+52) testScrollInsensitiveConcurUpdatableWithoutForUpdate3(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)SQL Exception: 'updateInt' not allowed because the ResultSet is not an updatable ResultSet. 
+There were 8 failures:
+1) testScrollablePositionedUpdateWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Expected row to be updated by own change,  however did not get updated value for column a expected:<666> but was:<0>
+2) testScrollInsensitiveConcurUpdatableWithForUpdate2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Invalid resultset concurrency on statement expected:<1008> but was:<1007>
+3) testScrollablePositionedUpdateWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Expected row to be updated by own change,  however did not get updated value for column a expected:<666> but was:<0>
+4) testScrollInsensitiveConcurUpdatableWithForUpdate2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Invalid resultset concurrency on statement expected:<1008> but was:<1007>
+5) testScrollablePositionedUpdateWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Expected row to be updated by own change,  however did not get updated value for column a expected:<666> but was:<0>
+6) testScrollInsensitiveConcurUpdatableWithForUpdate2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Invalid resultset concurrency on statement expected:<1008> but was:<1007>
+7) testScrollablePositionedUpdateWithForUpdate1(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Expected row to be updated by own change,  however did not get updated value for column a expected:<666> but was:<0>
+8) testScrollInsensitiveConcurUpdatableWithForUpdate2(org.apache.derbyTesting.functionTests.tests.jdbcapi.SURTest)junit.framework.AssertionFailedError: Invalid resultset concurrency on statement expected:<1008> but was:<1007>
+FAILURES!!!
+Tests run: 128,  Failures: 8,  Errors: 52

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNet.exclude
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNet.exclude?rev=378045&r1=378044&r2=378045&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNet.exclude (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNet.exclude Wed Feb 15 10:18:47 2006
@@ -35,3 +35,8 @@
 # excluding jdbcapi/derbyStress.java - jcc runs out of memory with this test
 jdbcapi/derbyStress.java
 largedata/LobLimits.java
+# These next three fail with an error saying that a null username is not 
+# supported
+jdbcapi/SURQueryMixTest.junit
+jdbcapi/SURTest.junit
+jdbcapi/ConcurrencyTest.junit

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=378045&r1=378044&r2=378045&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 Wed Feb 15 10:18:47 2006
@@ -2,4 +2,5 @@
 jdbcapi/xaSimplePositive.sql
 jdbcapi/xaStateTran.sql
 jdbcapi/lobStreams.java
-
+jdbcapi/SURQueryMixTest.junit
+jdbcapi/SURTest.junit

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall?rev=378045&r1=378044&r2=378045&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall Wed Feb 15 10:18:47 2006
@@ -20,3 +20,5 @@
 jdbcapi/testRelative.java
 jdbcapi/rsgetXXXcolumnNames.java
 jdbcapi/Stream.java
+jdbcapi/SURQueryMixTest.junit
+jdbcapi/SURTest.junit

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest.java?rev=378045&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest.java (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest.java Wed Feb 15 10:18:47 2006
@@ -0,0 +1,843 @@
+/*
+ *
+ * Derby - Class ConcurrencyTest
+ *
+ * Copyright 2006 The Apache Software Foundation or its
+ * licensors, as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the License.
+ */
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+import junit.framework.*;
+import java.sql.*;
+
+/**
+ * Testing concurrency behaviour in derby when creating the resultsets with
+ * different parameters.
+ * @author Andreas Korneliussen
+ */
+public class ConcurrencyTest extends SURBaseTest {
+    
+    /** Creates a new instance of ConcurrencyTest */
+    public ConcurrencyTest(String name) {
+        super(name);
+    }
+
+    /**
+     * Sets up the connection, then create the data model
+     */
+    public void setUp() 
+        throws Exception 
+    {      
+        try {
+            super.setUp();
+        } catch (SQLException e) {
+            if (con!=null) tearDown();
+            throw e;
+        }
+        // For the concurrency tests, we recreate the model
+        // for each testcase (since we do commits)
+        SURDataModelSetup.createDataModel
+            (SURDataModelSetup.SURDataModel.MODEL_WITH_PK, con);
+        con.commit();
+    }
+    
+    public void tearDown() 
+    {
+        try {
+            con.rollback();
+            Statement dropStatement = con.createStatement();
+            dropStatement.execute("drop table t1");
+            con.commit();
+            con.close();
+        } catch (SQLException e) {
+            printStackTrace(e); // Want to propagate the real exception.
+        }
+    }
+    
+    /**
+     * Test that update locks are downgraded to shared locks
+     * after repositioning.
+     * This test fails with Derby
+     */
+    public void testUpdateLockDownGrade1()
+        throws SQLException 
+    {
+        Statement s = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, 
+                                          ResultSet.CONCUR_UPDATABLE);
+        ResultSet rs = s.executeQuery("select * from t1 for update");
+        
+        // After navigating through the resultset, 
+        // presumably all rows are locked with shared locks
+        while (rs.next());
+        
+        // Now open up a connection
+        Connection con2 = getNewConnection();
+        Statement s2 = con2.createStatement(ResultSet.TYPE_FORWARD_ONLY, 
+                                            ResultSet.CONCUR_UPDATABLE);
+        
+        ResultSet rs2 = s2.executeQuery("select * from t1 for update");
+        try {
+            rs2.next(); // We should be able to get a update lock here.
+        } catch (SQLException e) {
+            assertEquals("Unexpected SQL state",  LOCK_TIMEOUT_SQL_STATE,
+                         e.getSQLState());
+            return;
+        } finally {
+            con2.rollback();
+        }
+        assertTrue("Expected Derby to hold updatelocks in RR mode", false);
+    }
+    
+    /**
+     * Test that we can aquire a update lock even if the row is locked with 
+     * a shared lock.
+     */
+    public void testAquireUpdateLock1()
+        throws SQLException 
+    {
+        Statement s = con.createStatement();
+        ResultSet rs = s.executeQuery("select * from t1");
+        
+        // After navigating through the resultset, 
+        // presumably all rows are locked with shared locks
+        while (rs.next());
+        
+        // Now open up a connection
+        Connection con2 = getNewConnection();
+        Statement s2 = con2.createStatement(ResultSet.TYPE_FORWARD_ONLY, 
+                                            ResultSet.CONCUR_UPDATABLE);
+        
+        ResultSet rs2 = s2.executeQuery("select * from t1 for update");
+        try {
+            rs2.next(); // We should be able to get a update lock here.
+        } finally {
+            con2.rollback();
+        }
+    }
+    
+    /*
+     * Test that we do not get a concurrency problem when opening two cursors
+     * as readonly.
+     **/
+    public void testSharedLocks1()
+        throws SQLException 
+    {
+        Statement s = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, 
+                                          ResultSet.CONCUR_READ_ONLY);
+        final ResultSet rs = s.executeQuery("select * from t1");
+        scrollForward(rs);
+        Connection con2 = getNewConnection();
+        Statement s2 = con2.createStatement(ResultSet.TYPE_FORWARD_ONLY, 
+                                            ResultSet.CONCUR_READ_ONLY);
+        try {
+            final ResultSet rs2 = s2.executeQuery("select * from t1");
+            scrollForward(rs2);
+        } finally {
+            rs.close();
+            con2.rollback();
+            con2.close();
+        }
+    }
+    
+    /*
+     * Test that we do not get a concurrency problem when opening two cursors 
+     * reading the same data (no parameters specified to create statement).
+     **/
+    public void testSharedLocks2()
+        throws SQLException 
+    {
+        Statement s = con.createStatement();
+        ResultSet rs = s.executeQuery("select * from t1");
+        scrollForward(rs);
+        Connection con2 = getNewConnection();
+        Statement s2 = con2.createStatement();
+        try {
+            final ResultSet rs2 = s2.executeQuery("select * from t1");
+            scrollForward(rs2);
+        } finally {
+            rs.close();
+            con2.rollback();
+            con2.close();
+        }
+    }
+    
+    /*
+     * Test that we do not get a concurrency problem when opening one cursor
+     * as updatable (not using "for update"), and another cursor as read only
+     **/
+    public void testSharedAndUpdateLocks1()
+        throws SQLException {
+        Statement s = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, 
+                                          ResultSet.CONCUR_UPDATABLE);
+        
+        ResultSet rs = s.executeQuery("select * from t1");
+        scrollForward(rs);
+        Connection con2 = getNewConnection();
+        Statement s2 = con2.createStatement(ResultSet.TYPE_FORWARD_ONLY, 
+                                            ResultSet.CONCUR_READ_ONLY);
+        try {
+            final ResultSet rs2 = s2.executeQuery("select * from t1");
+            scrollForward(rs2);
+        } finally {
+            rs.close();
+            con2.rollback();
+            con2.close();
+        }
+    }
+    
+    /*
+     * Test that we do no get a concurrency problem when opening one cursor
+     * as updatable (using "for update"), and another cursor as read only.
+     *
+     **/
+    public void testSharedAndUpdateLocks2()
+        throws SQLException 
+    {
+        Statement s = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, 
+                                          ResultSet.CONCUR_UPDATABLE);
+        ResultSet rs = s.executeQuery("select * from t1 for update");
+        scrollForward(rs);
+        Connection con2 = getNewConnection();
+        Statement s2 = con2.createStatement(ResultSet.TYPE_FORWARD_ONLY, 
+                                            ResultSet.CONCUR_READ_ONLY);
+        try {
+            final ResultSet rs2 = s2.executeQuery("select * from t1");
+            scrollForward(rs2);
+        } finally {
+            rs.close();
+            con2.rollback();
+            con2.close();
+        }
+    }
+    
+    /**
+     * Test what happens if you update a deleted + purged tuple.
+     * The transaction which deletes the tuple, will also
+     * ensure that the tuple is purged from the table, not only marked
+     * as deleted.
+     **/
+    public void testUpdatePurgedTuple1()
+        throws SQLException
+    {
+        con.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
+        Statement s = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, 
+                                          ResultSet.CONCUR_UPDATABLE);
+        ResultSet rs = s.executeQuery("select * from t1");
+        rs.next();
+        int firstKey = rs.getInt(1);
+        println("T1: Read next Tuple:(" + rs.getInt(1) + "," +
+                rs.getInt(2) + "," +
+                rs.getInt(3) + ")");
+        int lastKey = firstKey;
+        while (rs.next()) {
+            lastKey = rs.getInt(1);
+            println("T1: Read next Tuple:(" + rs.getInt(1) + "," +
+                    rs.getInt(2) + "," +
+                    rs.getInt(3) + ")");
+        }
+        
+        Connection con2 = getNewConnection();
+        con2.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+        try {
+            PreparedStatement ps2 = con2.prepareStatement
+                ("delete from t1 where id=? or id=?");
+            ps2.setInt(1, firstKey);
+            ps2.setInt(2, lastKey);
+            assertEquals("Expected two records to be deleted", 
+                         2, ps2.executeUpdate());
+            println("T2: Deleted records with id=" + firstKey + " and id=" + 
+                    lastKey);
+            con2.commit();
+            println("T2: commit");
+            ps2 = con2.prepareStatement
+                ("call SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE(?,?,?,?,?)");
+            ps2.setString(1, "APP"); // schema
+            ps2.setString(2, "T1");  // table name
+            ps2.setInt(3, 1); // purge
+            ps2.setInt(4, 0); // defragment rows
+            ps2.setInt(5, 0); // truncate end
+            println("T3: call SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE");
+            println("T3: purges deleted records");
+            ps2.executeUpdate();
+            con2.commit();
+            println("T3: commit");
+        } catch (SQLException e) {
+            con2.rollback();
+            throw e;
+        }
+        rs.first(); // Go to first tuple
+        println("T1: Read first Tuple:(" + rs.getInt(1) + "," +
+                rs.getInt(2) + "," +
+                rs.getInt(3) + ")");
+        rs.updateInt(2, 3);
+        println("T1: updateInt(2, 3);");
+        rs.updateRow();
+        println("T1: updateRow()");
+        rs.last(); // Go to last tuple
+        println("T1: Read last Tuple:(" + rs.getInt(1) + "," +
+                rs.getInt(2) + "," +
+                rs.getInt(3) + ")");
+        rs.updateInt(2, 3);
+        println("T1: updateInt(2, 3);");
+        rs.updateRow();
+        println("T1: updateRow()");
+        con.commit();
+        println("T1: commit");
+        rs = s.executeQuery("select * from t1");
+        println("T3: select * from table");
+        while (rs.next()) {
+            println("T3: Read next Tuple:(" + rs.getInt(1) + "," +
+                    rs.getInt(2) + "," +
+                    rs.getInt(3) + ")");
+            
+        }
+    }
+    
+    /**
+     * Test what happens if you update a deleted tuple using positioned update
+     * (same as testUpdatePurgedTuple1, except here we use positioned updates)
+     **/
+    public void testUpdatePurgedTuple2()
+        throws SQLException 
+    {
+        con.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+        Statement s = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, 
+                                          ResultSet.CONCUR_UPDATABLE);
+        ResultSet rs = s.executeQuery("select * from t1");
+        rs.next(); // Point to first tuple
+        println("T1: Read next Tuple:(" + rs.getInt(1) + "," +
+                rs.getInt(2) + "," +
+                rs.getInt(3) + ")");
+        int firstKey = rs.getInt(1);
+        rs.next(); // Go to next
+        println("T1: Read next Tuple:(" + rs.getInt(1) + "," +
+                rs.getInt(2) + "," +
+                rs.getInt(3) + ")");
+        Connection con2 = getNewConnection();
+        con2.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+        try {
+            PreparedStatement ps2 = con2.prepareStatement
+                ("delete from t1 where id=?");
+            ps2.setInt(1, firstKey);
+            assertEquals("Expected one record to be deleted", 1, 
+                         ps2.executeUpdate());
+            println("T2: Deleted record with id=" + firstKey);
+            con2.commit();
+            println("T2: commit");
+        } catch (SQLException e) {
+            con2.rollback();
+            throw e;
+        }
+        rs.previous(); // Go back to first tuple
+        println("T1: Read previous Tuple:(" + rs.getInt(1) + "," +
+                rs.getInt(2) + "," +
+                rs.getInt(3) + ")");
+        
+        PreparedStatement ps = con.prepareStatement
+            ("update T1 set a=? where current of " + rs.getCursorName());
+        ps.setInt(1, 3);
+        int updateCount = ps.executeUpdate();
+        println("T1: update table, set a=3 where current of " + 
+                rs.getCursorName());
+        println("T1: commit");
+        con.commit();
+        rs = s.executeQuery("select * from t1");
+        while (rs.next()) {
+            println("T3: Tuple:(" + rs.getInt(1) + "," +
+                    rs.getInt(2) + "," +
+                    rs.getInt(3) + ")");
+            
+        }
+    }
+    
+    /**
+     * Test what happens if you update a tuple which is deleted, purged and
+     * reinserted
+     **/
+    public void testUpdatePurgedTuple3()
+        throws SQLException 
+    {
+        con.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+        Statement s = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, 
+                                          ResultSet.CONCUR_UPDATABLE);
+        ResultSet rs = s.executeQuery("select * from t1");
+        rs.next(); // Point to first tuple
+        int firstKey = rs.getInt(1);
+        println("T1: read tuple with key " + firstKey);
+        rs.next(); // Go to next
+        println("T1: read next tuple");
+        Connection con2 = getNewConnection();
+        con2.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+        try {
+            PreparedStatement ps2 = con2.prepareStatement
+                ("delete from t1 where id=?");
+            ps2.setInt(1, firstKey);
+            assertEquals("Expected one record to be deleted", 1, 
+                         ps2.executeUpdate());
+            println("T2: Deleted record with id=" + firstKey);
+            con2.commit();
+            println("T2: commit");
+            
+            // Now purge the table
+            ps2 = con2.prepareStatement
+                ("call SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE(?,?,?,?,?)");
+            ps2.setString(1, "APP"); // schema
+            ps2.setString(2, "T1");  // table name
+            ps2.setInt(3, 1); // purge
+            ps2.setInt(4, 0); // defragment rows
+            ps2.setInt(5, 0); // truncate end
+            println("T3: call SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE");
+            println("T3: purges deleted records");
+            ps2.executeUpdate();
+            con2.commit();
+            
+            ps2 = con2.prepareStatement("insert into t1 values(?,?,?,?)");
+            ps2.setInt(1, firstKey);
+            ps2.setInt(2, -1);
+            ps2.setInt(3, -1);
+            ps2.setString(4, "UPDATED TUPLE");
+            assertEquals("Expected one record to be inserted", 1, 
+                         ps2.executeUpdate());
+            println("T4: Inserted record (" + firstKey + ",-1,-1)" );
+            con2.commit();
+            println("T4: commit");
+        } catch (SQLException e) {
+            con2.rollback();
+            throw e;
+        }
+        println("T1: read previous tuple");
+        rs.previous(); // Go back to first tuple
+        println("T1: id=" + rs.getInt(1));
+        rs.updateInt(2, 3);
+        println("T1: updateInt(2, 3);");
+        rs.updateRow();
+        println("T1: updated column 2, to value=3");
+        println("T1: commit");
+        con.commit();
+        rs = s.executeQuery("select * from t1");
+        while (rs.next()) {
+            println("T5: Read Tuple:(" + rs.getInt(1) + "," +
+                    rs.getInt(2) + "," +
+                    rs.getInt(3) + ")");
+            
+        }
+    }
+    
+    /**
+     * Test what happens if you update a tuple which is deleted, purged and 
+     * then reinserted with the exact same values
+     **/
+    public void testUpdatePurgedTuple4()
+        throws SQLException 
+    {
+        con.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+        Statement s = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, 
+                                          ResultSet.CONCUR_UPDATABLE);
+        ResultSet rs = s.executeQuery("select * from t1");
+        rs.next(); // Point to first tuple
+        int firstKey = rs.getInt(1);
+        int valA = rs.getInt(2);
+        int valB = rs.getInt(3);
+        
+        println("T1: Read next Tuple:(" + rs.getInt(1) + "," +
+                rs.getInt(2) + "," +
+                rs.getInt(3) + ")");
+        
+        rs.next(); // Go to next
+        println("T1: Read next Tuple:(" + rs.getInt(1) + "," +
+                rs.getInt(2) + "," +
+                rs.getInt(3) + ")");
+        Connection con2 = getNewConnection();
+        con2.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+        try {
+            PreparedStatement ps2 = con2.prepareStatement
+                ("delete from t1 where id=?");
+            ps2.setInt(1, firstKey);
+            assertEquals("Expected one record to be deleted", 1, 
+                         ps2.executeUpdate());
+            println("T2: Deleted record with id=" + firstKey);
+            con2.commit();
+            println("T2: commit");
+            
+            // Now purge the table
+            ps2 = con2.prepareStatement
+                ("call SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE(?,?,?,?,?)");
+            ps2.setString(1, "APP"); // schema
+            ps2.setString(2, "T1");  // table name
+            ps2.setInt(3, 1); // purge
+            ps2.setInt(4, 0); // defragment rows
+            ps2.setInt(5, 0); // truncate end
+            println("T3: call SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE");
+            println("T3: purges deleted records");
+            ps2.executeUpdate();
+            con2.commit();
+            println("T3: commit");
+            
+            ps2 = con2.prepareStatement("insert into t1 values(?,?,?,?)");
+            ps2.setInt(1, firstKey);
+            ps2.setInt(2, valA);
+            ps2.setInt(3, valB);
+            ps2.setString(4, "UPDATE TUPLE " + firstKey);
+            assertEquals("Expected one record to be inserted", 1, 
+                         ps2.executeUpdate());
+            println("T4: Inserted record (" + firstKey + "," + valA + "," + 
+                    valB + ")" );
+            con2.commit();
+            println("T4: commit");
+        } catch (SQLException e) {
+            con2.rollback();
+            throw e;
+        }
+        rs.previous(); // Go back to first tuple
+        println("T1: Read previous Tuple:(" + rs.getInt(1) + "," +
+                rs.getInt(2) + "," +
+                rs.getInt(3) + ")");
+        
+        println("T1: id=" + rs.getInt(1));
+        rs.updateInt(2, 3);
+        rs.updateRow();
+        println("T1: updated column 2, to value=3");
+        println("T1: commit");
+        con.commit();
+        rs = s.executeQuery("select * from t1");
+        while (rs.next()) {
+            println("T4: Read next Tuple:(" + rs.getInt(1) + "," +
+                    rs.getInt(2) + "," +
+                    rs.getInt(3) + ")");
+            
+        }
+    }
+    
+    /**
+     * Test what happens if you update a tuple which has been modified by 
+     * another transaction.
+     **/
+    public void testUpdateModifiedTuple1()
+        throws SQLException 
+    {
+        con.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+        Statement s = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, 
+                                          ResultSet.CONCUR_UPDATABLE);
+        ResultSet rs = s.executeQuery("select * from t1");
+        rs.next(); // Point to first tuple
+        println("T1: Read next Tuple:(" + rs.getInt(1) + "," +
+                rs.getInt(2) + "," +
+                rs.getInt(3) + ")");
+        int firstKey = rs.getInt(1);
+        rs.next(); // Go to next
+        println("T1: Read next Tuple:(" + rs.getInt(1) + "," +
+                rs.getInt(2) + "," +
+                rs.getInt(3) + ")");
+        Connection con2 = getNewConnection();
+        con2.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+        try {
+            PreparedStatement ps2 = con2.prepareStatement
+                ("update t1 set b=? where id=?");
+            ps2.setInt(1, 999);
+            ps2.setInt(2, firstKey);
+            assertEquals("Expected one record to be updated", 1, 
+                         ps2.executeUpdate());
+            println("T2: Updated b=999 where id=" + firstKey);
+            con2.commit();
+            println("T2: commit");
+        } catch (SQLException e) {
+            con2.rollback();
+            throw e;
+        }
+        rs.previous(); // Go back to first tuple
+        println("T1: Read previous Tuple:(" + rs.getInt(1) + "," +
+                rs.getInt(2) + "," +
+                rs.getInt(3) + ")");
+        rs.updateInt(2, 3);
+        rs.updateRow();
+        println("T1: updated column 2, to value=3");
+        con.commit();
+        println("T1: commit");
+        rs = s.executeQuery("select * from t1");
+        while (rs.next()) {
+            println("T3: Read next Tuple:(" + rs.getInt(1) + "," +
+                    rs.getInt(2) + "," +
+                    rs.getInt(3) + ")");
+            
+        }
+    }
+    
+    /**
+     * Test what happens if you update a tuple which has been modified by 
+     * another transaction (in this case the same column)
+     **/
+    public void testUpdateModifiedTuple2()
+        throws SQLException 
+    {
+        con.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+        Statement s = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, 
+                                          ResultSet.CONCUR_UPDATABLE);
+        ResultSet rs = s.executeQuery("select * from t1");
+        rs.next(); // Point to first tuple
+        println("T1: Read next Tuple:(" + rs.getInt(1) + "," +
+                rs.getInt(2) + "," +
+                rs.getInt(3) + ")");
+        int firstKey = rs.getInt(1);
+        rs.next(); // Go to next
+        println("T1: Read next Tuple:(" + rs.getInt(1) + "," +
+                rs.getInt(2) + "," +
+                rs.getInt(3) + ")");
+        Connection con2 = getNewConnection();
+        con2.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+        try {
+            PreparedStatement ps2 = con2.prepareStatement
+                ("update t1 set b=? where id=?");
+            ps2.setInt(1, 999);
+            ps2.setInt(2, firstKey);
+            assertEquals("Expected one record to be updated", 1, 
+                         ps2.executeUpdate());
+            println("T2: Updated b=999 where id=" + firstKey);
+            con2.commit();
+            println("T2: commit");
+        } catch (SQLException e) {
+            con2.rollback();
+            throw e;
+        }
+        rs.previous(); // Go back to first tuple
+        println("T1: Read previous Tuple:(" + rs.getInt(1) + "," +
+                rs.getInt(2) + "," +
+                rs.getInt(3) + ")");
+        rs.updateInt(3, 9999);
+        rs.updateRow();
+        println("T1: updated column 3, to value=9999");
+        con.commit();
+        println("T1: commit");
+        rs = s.executeQuery("select * from t1");
+        while (rs.next()) {
+            println("T3: Read next Tuple:(" + rs.getInt(1) + "," +
+                    rs.getInt(2) + "," +
+                    rs.getInt(3) + ")");
+            
+        }
+    }
+    
+    /**
+     * Tests that a ResultSet opened even in read uncommitted, gets a 
+     * table intent lock, and that another transaction then cannot compress 
+     * the table while the ResultSet is open.
+     **/
+    public void testTableIntentLock1()
+        throws SQLException 
+    {
+        con.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
+        Statement s = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, 
+                                          ResultSet.CONCUR_UPDATABLE);
+        println("T1: select * from t1");
+        ResultSet rs = s.executeQuery("select * from t1 for update");
+        while (rs.next()) {
+            println("T1: Read next Tuple:(" + rs.getInt(1) + "," +
+                    rs.getInt(2) + "," +
+                    rs.getInt(3) + ")");
+        } // Now the cursor does not point to any tuples
+        
+        // Compressing the table in another transaction:
+        Connection con2 = getNewConnection();
+        try {
+            con2.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+            PreparedStatement ps2 = con2.prepareStatement
+                ("call SYSCS_UTIL.SYSCS_COMPRESS_TABLE(?, ?, ?)");
+            ps2.setString(1, "APP");
+            ps2.setString(2, "T1");
+            ps2.setInt(3, 0);
+            println("T2: call SYSCS_UTIL.SYSCS_COMPRESS_TABLE(APP, T1, 0)");
+            ps2.executeUpdate(); // This will hang
+            assertTrue("Expected T2 to hang", false);
+        } catch (SQLException e) {
+            println("T2: Got exception:" + e.getMessage());
+            
+            assertEquals("Unexpected SQL state", 
+                         LOCK_TIMEOUT_EXPRESSION_SQL_STATE,
+                         e.getSQLState());
+        } finally {
+            con2.rollback();
+        }
+    }
+    
+    /**
+     * Test that Derby set updatelock on current row when using
+     * read-uncommitted
+     **/
+    public void testUpdateLockInReadUncommitted()
+        throws SQLException 
+    {
+        con.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
+        Statement s = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, 
+                                          ResultSet.CONCUR_UPDATABLE);
+        ResultSet rs = s.executeQuery("select * from t1");
+        rs.next();
+        int firstKey = rs.getInt(1);
+        println("T1: Read next Tuple:(" + rs.getInt(1) + "," +
+                rs.getInt(2) + "," +
+                rs.getInt(3) + ")");
+        Connection con2 = getNewConnection();
+        con2.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+        try {
+            PreparedStatement ps2 = con2.prepareStatement
+                ("delete from t1 where id=?");
+            ps2.setInt(1, firstKey);
+            ps2.executeUpdate();
+            assertTrue("expected record with id=" + firstKey + 
+                       " to be locked", false);
+        } catch (SQLException e) {
+            assertEquals("Unexpected SQL state",  LOCK_TIMEOUT_SQL_STATE,
+                         e.getSQLState());
+        } finally {
+            con2.rollback();
+        }          
+    }
+    
+    /**
+     * Test that the system cannot defragment any records
+     * as long as an updatable result set is open against the table.
+     **/
+    public void testDefragmentDuringScan() 
+        throws SQLException
+    {
+        testCompressDuringScan(true, false);
+    }
+    /**
+     * Test that the system cannot truncate any records
+     * as long as an updatable result set is open against the table.
+     **/
+    public void testTruncateDuringScan() 
+        throws SQLException
+    {
+        testCompressDuringScan(false, true);
+    }
+    
+    /**
+     * Test that the system does not purge any records
+     * as long as we do either a defragment, or truncate
+     **/
+    private void testCompressDuringScan(boolean testDefragment, 
+                                        boolean testTruncate)
+        throws SQLException 
+    {
+        con.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
+        Statement delStatement = con.createStatement();
+        // First delete all records except the last and first
+        int deleted = delStatement.executeUpdate
+            ("delete from T1 where id>0 and id<" + (recordCount-1));
+        int expectedDeleted = recordCount-2;    
+        println("T1: delete records");
+        assertEquals("Invalid number of records deleted", expectedDeleted, 
+                     deleted);
+        con.commit();
+        println("T1: commit");
+        
+        Statement s = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, 
+                                          ResultSet.CONCUR_UPDATABLE);
+        ResultSet rs = s.executeQuery("select * from t1");
+        rs.next();
+        int firstKey = rs.getInt(1);
+        println("T2: Read next Tuple:(" + rs.getInt(1) + "," +
+                rs.getInt(2) + "," +
+                rs.getInt(3) + ")");
+        int lastKey = firstKey;
+        while (rs.next()) {
+            lastKey = rs.getInt(1);
+            println("T2: Read next Tuple:(" + rs.getInt(1) + "," +
+                    rs.getInt(2) + "," +
+                    rs.getInt(3) + ")");
+        }
+        
+        final Connection con2 = getNewConnection();
+        con2.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
+        final PreparedStatement ps2 = con2.prepareStatement
+            ("call SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE(?,?,?,?,?)");
+        ps2.setString(1, "APP"); // schema
+        ps2.setString(2, "T1");  // table name
+        ps2.setInt(3, 0); // purge
+        int defragment = testDefragment ? 1 : 0;
+        int truncate = testTruncate ? 1 : 0;
+        ps2.setInt(4, defragment); // defragment rows
+        ps2.setInt(5, truncate); // truncate end
+        
+        println("T3: call SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE");
+        println("T3: defragmenting rows");
+        try { 
+            ps2.executeUpdate();
+            con2.commit();
+            println("T3: commit");
+            assertTrue("Expected T3 to hang waiting for Table lock", false);
+        } catch (SQLException e) {            
+            println("T3: got expected exception");
+            con2.rollback();            
+        }
+        rs.first(); // Go to first tuple
+        println("T1: Read first Tuple:(" + rs.getInt(1) + "," +
+                rs.getInt(2) + "," +
+                rs.getInt(3) + ")");
+        rs.updateInt(2, 3);
+        println("T1: updateInt(2, 3);");
+        rs.updateRow();        
+        println("T1: updateRow()");
+        rs.last(); // Go to last tuple
+        println("T1: Read last Tuple:(" + rs.getInt(1) + "," +
+                rs.getInt(2) + "," +
+                rs.getInt(3) + ")");
+        rs.updateInt(2, 3);
+        println("T1: updateInt(2, 3);");
+        rs.updateRow();
+        println("T1: updateRow()");
+        con.commit();
+        println("T1: commit");
+        rs = s.executeQuery("select * from t1");
+        println("T4: select * from table");
+        while (rs.next()) {
+            println("T4: Read next Tuple:(" + rs.getInt(1) + "," +
+                    rs.getInt(2) + "," +
+                    rs.getInt(3) + ")");
+        }
+    }
+    
+    // By providing a static suite(), you can customize which tests to run.
+    // The default is to run all tests in the TestCase subclass.
+    
+    public static Test suite() {
+        TestSuite suite = new TestSuite();
+        
+        suite.addTest(new ConcurrencyTest("testUpdateLockDownGrade1"));
+        suite.addTest(new ConcurrencyTest("testAquireUpdateLock1"));
+                
+        suite.addTest(new ConcurrencyTest("testSharedLocks1"));
+        suite.addTest(new ConcurrencyTest("testSharedLocks2"));
+        suite.addTest(new ConcurrencyTest("testSharedAndUpdateLocks1"));
+        suite.addTest(new ConcurrencyTest("testSharedAndUpdateLocks2"));
+        
+        // The following testcases requires Scrollable Updatable ResultSets:
+//         suite.addTest(new ConcurrencyTest("testUpdatePurgedTuple1"));
+//         suite.addTest(new ConcurrencyTest("testUpdatePurgedTuple2"));
+//         suite.addTest(new ConcurrencyTest("testUpdatePurgedTuple3"));
+//         suite.addTest(new ConcurrencyTest("testUpdatePurgedTuple4"));
+        
+        
+//         suite.addTest(new ConcurrencyTest("testUpdateModifiedTuple1"));
+//         suite.addTest(new ConcurrencyTest("testUpdateModifiedTuple2"));
+//         suite.addTest(new ConcurrencyTest("testTableIntentLock1"));
+//         suite.addTest(new ConcurrencyTest("testUpdateLockInReadUncommitted"));
+//         suite.addTest(new ConcurrencyTest("testDefragmentDuringScan"));
+//         suite.addTest(new ConcurrencyTest("testTruncateDuringScan"));
+        /// ---------------
+                
+            
+        return suite;
+    }
+    
+}

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest_app.properties?rev=378045&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest_app.properties (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest_app.properties Wed Feb 15 10:18:47 2006
@@ -0,0 +1,3 @@
+runwithibm13=false
+runwithjdk13=false
+runwithjdk12=false

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest_app.properties
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message