You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by km...@apache.org on 2006/02/09 15:02:21 UTC

svn commit: r376296 - in /db/derby/code/trunk/java: drda/org/apache/derby/impl/drda/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ testing/org/apache/derbyTesting/functionTests/mast...

Author: kmarsden
Date: Thu Feb  9 06:02:18 2006
New Revision: 376296

URL: http://svn.apache.org/viewcvs?rev=376296&view=rev
Log:
DERBY-898 setAutoCommit(false) is not working properly with connections objtained with ClientXADataSource.

- Changes server side connection for network server XA to autocommit false. Even when the client has autocommit on, the server side connection should be autocommit false and let the client drive the commits.

- Adds connections obtained from an XADataSource to the savepointJdbc30_XA test to verify that autocommit is being set properly and also verify that DERBY-899 (a dup of this issue) is fixed.


Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/savepointJdbc30_XA.out   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/savepointJdbc30_XA.out   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_XA.java   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_XA_app.properties   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_XA_derby.properties   (with props)
Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/XADatabase.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/savepointJdbc30_JSR169.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/savepointJdbc30_JSR169.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/savepointJdbc30_JSR169.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNet.exclude
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdk14.runall
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_JSR169.java

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/XADatabase.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/XADatabase.java?rev=376296&r1=376295&r2=376296&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/XADatabase.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/XADatabase.java Thu Feb  9 06:02:18 2006
@@ -89,6 +89,9 @@
 		
 		// Get a new logical connection.
 		conn = xaConnection.getConnection();
+		// Client will always drive the commits so connection should
+		// always be autocommit false on the server. DERBY-898/DERBY-899
+		conn.setAutoCommit(false);
 		setConnection(conn);
 		return conn;
 		

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/savepointJdbc30_JSR169.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/savepointJdbc30_JSR169.out?rev=376296&r1=376295&r2=376296&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/savepointJdbc30_JSR169.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/savepointJdbc30_JSR169.out Thu Feb  9 06:02:18 2006
@@ -1,4 +1,5 @@
 Test savepointJdbc30 starting
+Test savepointJdbc30 starting for regular connections
 Tests common to DRDA and embedded Cloudscape
 Test1 - no unnamed savepoints allowed if autocommit is true
 Expected Exception is Cannot set savepoint when in auto-commit mode.
@@ -72,4 +73,3 @@
 Test 26b release  of null savepoint
 Expected Exception is Cannot release a null savepoint.
 Next try non-DRDA tests
-Test savepointJdbc30 finished

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/savepointJdbc30_JSR169.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/savepointJdbc30_JSR169.out?rev=376296&r1=376295&r2=376296&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/savepointJdbc30_JSR169.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/savepointJdbc30_JSR169.out Thu Feb  9 06:02:18 2006
@@ -1,4 +1,5 @@
 Test savepointJdbc30 starting
+Test savepointJdbc30 starting for regular connections
 Tests common to DRDA and embedded Cloudscape
 Test1 - no unnamed savepoints allowed if autocommit is true
 Expected Exception is Cannot set savepoint when in auto-commit mode.
@@ -72,4 +73,3 @@
 Test 26b release  of null savepoint
 Expected Exception is Cannot release a null savepoint.
 Next try non-DRDA tests
-Test savepointJdbc30 finished

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/savepointJdbc30_XA.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/savepointJdbc30_XA.out?rev=376296&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/savepointJdbc30_XA.out (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/savepointJdbc30_XA.out Thu Feb  9 06:02:18 2006
@@ -0,0 +1,74 @@
+Test savepointJdbc30 starting for connections from XADataSource (local tranasaction)
+Tests common to DRDA and embedded Cloudscape
+Test1 - no unnamed savepoints allowed if autocommit is true
+Expected Exception is Cannot set savepoint when in auto-commit mode.
+Test1a - no named savepoints allowed if autocommit is true
+Expected Exception is Cannot set savepoint when in auto-commit mode.
+Test2 - Release and reuse a savepoint name
+Test3 - null name not allowed for named savepoints
+Expected Exception is Named savepoint needs a none-null name.
+Test4 - Verify names/ids of named/unnamed savepoints
+Expected Exception is This is an un-named savepoint.
+Expected Exception is This is a named savepoint.
+Test5a - create two savepoints in two different transactions and release the first one in the subsequent transaction
+Expected Exception is SAVEPOINT, s1 does not  exist or is not active in the current transaction.
+Test5b - create two savepoints in two different transactions and rollback the first one in the subsequent transaction
+Expected Exception is SAVEPOINT, s1 does not  exist or is not active in the current transaction.
+Test6a - create a savepoint, release it, create another with same name and release the first one
+Expected Exception is SAVEPOINT, s1 does not  exist or is not active in the current transaction.
+Test6b - create a savepoint, release it, create another with same name and rollback the first one
+Expected Exception is SAVEPOINT, s1 does not  exist or is not active in the current transaction.
+Test6c - Try to use a savepoint from another connection for release
+Expected Exception is Cannot release a savepoint that was not created by this connection.
+Test7a - swap savepoints across connections with release
+Expected Exception is Cannot release a savepoint that was not created by this connection.
+Test7b - swap savepoints across connections with rollback
+Expected Exception is Rollback to a savepoint not created by this connection.
+Test 9 test savepoint name
+Test 10 test savepoint name case sensitivity
+Test 11 rolling back a savepoint multiple times - should work
+Test 12 releasing a savepoint multiple times - should not work
+Expected Exception is SAVEPOINT, MyName does not  exist or is not active in the current transaction.
+Test 13 shouldn't be able to use a savepoint from earlier transaction after setting autocommit on and off
+Expected Exception is SAVEPOINT, MyName does not  exist or is not active in the current transaction.
+Test 14 A non-user initiated transaction rollback should release the internal savepoint array
+Expected Exception is A lock could not be obtained within the time requested
+Expected Exception is SAVEPOINT, MyName does not  exist or is not active in the current transaction.
+Test 15 check savepoints in batch
+Test 16 grammar check for savepoint sq1
+Expected Exception is Syntax error: MISSING ON ROLLBACK RETAIN CURSORS.
+Expected Exception is Multiple or conflicting keywords involving the 'ON ROLLBACK RETAIN CURSORS' clause are present.
+Expected Exception is Multiple or conflicting keywords involving the 'ON ROLLBACK RETAIN LOCKS' clause are present.
+Expected Exception is Multiple or conflicting keywords involving the 'UNIQUE' clause are present.
+Test 17 No nested savepoints allowed when using SQL to set savepoints.
+Test 17a Test with UNIQUE clause.
+Expected Exception is The maximum number of savepoints has been reached. 
+Test 17b Test without UNIQUE clause.
+Since no nesting is allowed, skipping UNIQUE still gives error for trying to define another savepoint
+Expected Exception is The maximum number of savepoints has been reached. 
+Test 18 No nested SQL savepoints allowed inside JDBC savepoint.
+Following SQL savepoint will fail because we are trying to nest it inside JDBC savepoint
+Expected Exception is The maximum number of savepoints has been reached. 
+Test 19 No nested SQL savepoints allowed inside SQL savepoint.
+Following SQL savepoint will fail because we are trying to nest it inside SQL savepoint
+Expected Exception is The maximum number of savepoints has been reached. 
+Test 20 Rollback of SQL savepoint works same as rollback of JDBC savepoint.
+Test 21 After releasing the SQL savepoint, rollback the transaction and should see everything undone.
+Test 22 Should not be able to create a SQL savepoint starting with name SYS
+Expected Exception is An object cannot be created with the schema name 'SYS'.
+Test 23 Should be able to use non-reserved keywords savepoint and release as identifiers
+Create table with savepoint and release as identifiers
+Create a savepoint with name savepoint
+Release the savepoint with name savepoint
+Create a savepoint with name release
+Rollback to the savepoint with name release
+Release the savepoint with name release
+Test 24 Savepoint name can't exceed 128 characters
+Expected Exception is The name 'MyName1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890' is too long. The maximum length is '128'.
+Test 25 Should not be able to create a SQL savepoint starting with name SYS through jdbc
+Expected Exception is An object cannot be created with the schema name 'SYS'.
+Test 26a rollback of null savepoint
+Expected Exception is Cannot rollback to a null savepoint.
+Test 26b release  of null savepoint
+Expected Exception is Cannot release a null savepoint.
+Next try non-DRDA tests

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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/savepointJdbc30_JSR169.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/savepointJdbc30_JSR169.out?rev=376296&r1=376295&r2=376296&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/savepointJdbc30_JSR169.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/savepointJdbc30_JSR169.out Thu Feb  9 06:02:18 2006
@@ -1,4 +1,5 @@
 Test savepointJdbc30 starting
+Test savepointJdbc30 starting for regular connections
 Tests common to DRDA and embedded Cloudscape
 Test1 - no unnamed savepoints allowed if autocommit is true
 Expected Exception is Cannot issue savepoint when autoCommit is on.
@@ -99,4 +100,3 @@
 Following SQL savepoint will fail because we are trying to nest it inside JDBC savepoint
 Expected Exception is The maximum number of savepoints has been reached. 
 Expected Exception is The maximum number of savepoints has been reached. 
-Test savepointJdbc30 finished

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/savepointJdbc30_XA.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/savepointJdbc30_XA.out?rev=376296&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/savepointJdbc30_XA.out (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/savepointJdbc30_XA.out Thu Feb  9 06:02:18 2006
@@ -0,0 +1,101 @@
+Test savepointJdbc30 starting for connections from XADataSource (local tranasaction)
+Tests common to DRDA and embedded Cloudscape
+Test1 - no unnamed savepoints allowed if autocommit is true
+Expected Exception is Cannot issue savepoint when autoCommit is on.
+Test1a - no named savepoints allowed if autocommit is true
+Expected Exception is Cannot issue savepoint when autoCommit is on.
+Test2 - Release and reuse a savepoint name
+Test3 - null name not allowed for named savepoints
+Expected Exception is Cannot pass null for savepoint name.
+Test4 - Verify names/ids of named/unnamed savepoints
+Expected Exception is No name for un-named savepoints.
+Expected Exception is No ID for named savepoints.
+Test5a - create two savepoints in two different transactions and release the first one in the subsequent transaction
+Expected Exception is SAVEPOINT, s1 does not  exist or is not active in the current transaction.
+Test5b - create two savepoints in two different transactions and rollback the first one in the subsequent transaction
+Expected Exception is SAVEPOINT, s1 does not  exist or is not active in the current transaction.
+Test6a - create a savepoint, release it, create another with same name and release the first one
+Expected Exception is SAVEPOINT, s1 does not  exist or is not active in the current transaction.
+Test6b - create a savepoint, release it, create another with same name and rollback the first one
+Expected Exception is SAVEPOINT, s1 does not  exist or is not active in the current transaction.
+Test6c - Try to use a savepoint from another connection for release
+Expected Exception is A RELEASE or ROLLBACK TO SAVEPOINT was specified, but the savepoint does not exist.
+Test7a - swap savepoints across connections with release
+Expected Exception is A RELEASE or ROLLBACK TO SAVEPOINT was specified, but the savepoint does not exist.
+Test7b - swap savepoints across connections with rollback
+Expected Exception is A RELEASE or ROLLBACK TO SAVEPOINT was specified, but the savepoint does not exist.
+Test 9 test savepoint name
+Test 10 test savepoint name case sensitivity
+Test 11 rolling back a savepoint multiple times - should work
+Test 12 releasing a savepoint multiple times - should not work
+Expected Exception is SAVEPOINT, MyName does not  exist or is not active in the current transaction.
+Test 13 shouldn't be able to use a savepoint from earlier transaction after setting autocommit on and off
+Expected Exception is SAVEPOINT, MyName does not  exist or is not active in the current transaction.
+Test 14 A non-user initiated transaction rollback should release the internal savepoint array
+Expected Exception is A lock could not be obtained within the time requested
+Expected Exception is SAVEPOINT, MyName does not  exist or is not active in the current transaction.
+Test 15 check savepoints in batch
+Test 16 grammar check for savepoint sq1
+Expected Exception is Syntax error: MISSING ON ROLLBACK RETAIN CURSORS.
+Expected Exception is Multiple or conflicting keywords involving the 'ON ROLLBACK RETAIN CURSORS' clause are present.
+Expected Exception is Multiple or conflicting keywords involving the 'ON ROLLBACK RETAIN LOCKS' clause are present.
+Expected Exception is Multiple or conflicting keywords involving the 'UNIQUE' clause are present.
+Test 17 No nested savepoints allowed when using SQL to set savepoints.
+Test 17a Test with UNIQUE clause.
+Expected Exception is The maximum number of savepoints has been reached. 
+Test 17b Test without UNIQUE clause.
+Since no nesting is allowed, skipping UNIQUE still gives error for trying to define another savepoint
+Expected Exception is The maximum number of savepoints has been reached. 
+Test 18 No nested SQL savepoints allowed inside JDBC savepoint.
+Following SQL savepoint will fail because we are trying to nest it inside JDBC savepoint
+Expected Exception is The maximum number of savepoints has been reached. 
+Test 19 No nested SQL savepoints allowed inside SQL savepoint.
+Following SQL savepoint will fail because we are trying to nest it inside SQL savepoint
+Expected Exception is The maximum number of savepoints has been reached. 
+Test 20 Rollback of SQL savepoint works same as rollback of JDBC savepoint.
+Test 21 After releasing the SQL savepoint, rollback the transaction and should see everything undone.
+Test 22 Should not be able to create a SQL savepoint starting with name SYS
+Expected Exception is An object cannot be created with the schema name 'SYS'.
+Test 23 Should be able to use non-reserved keywords savepoint and release as identifiers
+Create table with savepoint and release as identifiers
+Create a savepoint with name savepoint
+Release the savepoint with name savepoint
+Create a savepoint with name release
+Rollback to the savepoint with name release
+Release the savepoint with name release
+Test 24 Savepoint name can't exceed 128 characters
+Expected Exception is The name 'MyName1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890' is too long. The maximum length is '128'.
+Test 25 Should not be able to create a SQL savepoint starting with name SYS through jdbc
+Expected Exception is An object cannot be created with the schema name 'SYS'.
+Test 26a rollback of null savepoint
+Expected Exception is SAVEPOINT, null does not  exist or is not active in the current transaction.
+Test 26b release  of null savepoint
+Expected Exception is SAVEPOINT, null does not  exist or is not active in the current transaction.
+Next try non-DRDA tests
+Test40 - named savepoint can't conflict with internally generated name for unnamed savepoints
+Test41a - Rollback to a savepoint, then try to release savepoint created after that savepoint
+Expected Exception is SAVEPOINT, s2 does not  exist or is not active in the current transaction.
+Test41b - Rollback to a savepoint, then try to rollback savepoint created after that savepoint
+Expected Exception is SAVEPOINT, s2 does not  exist or is not active in the current transaction.
+Test42 - Rollback/commit the transaction, then try to use savepoint from that transaction
+Expected Exception is SAVEPOINT, SAVEPT5 does not  exist or is not active in the current transaction.
+Expected Exception is SAVEPOINT, SAVEPT6 does not  exist or is not active in the current transaction.
+Test43 - Release and reuse a savepoint name
+Expected Exception is A SAVEPOINT with the passed name already exists in the current transaction.
+Test 45 reuse savepoint name after rollback - should not work
+Expected Exception is A SAVEPOINT with the passed name already exists in the current transaction.
+Test 46 Cursors declared before and within the savepoint unit will be closed when rolling back the savepoint
+Expected Exception is ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
+Expected Exception is ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
+Expected Exception is ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
+Expected Exception is ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
+Test 47 multiple tests for getSavepointId()
+8
+9
+10
+11
+12
+Test 48 No nested SQL savepoints allowed.
+Following SQL savepoint will fail because we are trying to nest it inside JDBC savepoint
+Expected Exception is The maximum number of savepoints has been reached. 
+Expected Exception is The maximum number of savepoints has been reached. 

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

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=376296&r1=376295&r2=376296&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 Thu Feb  9 06:02:18 2006
@@ -28,3 +28,5 @@
 jdbcapi/statementJdbc30.java
 lang/holdCursorJava.java
 jdbcapi/dataSourceReference.java
+#no XA for JCC
+jdbcapi/savepointJdbc30_XA.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdk14.runall
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdk14.runall?rev=376296&r1=376295&r2=376296&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdk14.runall (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdk14.runall Thu Feb  9 06:02:18 2006
@@ -7,4 +7,5 @@
 jdbcapi/resultsetJdbc30.java
 jdbcapi/statementJdbc30.java
 jdbcapi/savepointJdbc30_JSR169.java
+jdbcapi/savepointJdbc30_XA.java
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml?rev=376296&r1=376295&r2=376296&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml Thu Feb  9 06:02:18 2006
@@ -76,6 +76,7 @@
       <exclude name="${this.dir}/resultsetJdbc30.java"/>
       <exclude name="${this.dir}/statementJdbc30.java"/>
       <exclude name="${this.dir}/savepointJdbc30_JSR169.java"/>
+      <exclude name="${this.dir}/savepointJdbc30_XA.java"/>
       <exclude name="${this.dir}/xaJNDI.java"/>
       <exclude name="${this.dir}/lobStreams.java"/>
     </javac>
@@ -101,6 +102,7 @@
       <include name="${this.dir}/dbMetaDataJdbc30.java"/>
       <include name="${this.dir}/checkDataSource30.java"/>
       <include name="${this.dir}/savepointJdbc30_JSR169.java"/>
+      <include name="${this.dir}/savepointJdbc30_XA.java"/>
       <include name="${this.dir}/dataSourcePermissions.java"/>
       <include name="${this.dir}/parameterMetaDataJdbc30.java"/>
       <include name="${this.dir}/resultsetJdbc30.java"/>

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant?rev=376296&r1=376295&r2=376296&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant Thu Feb  9 06:02:18 2006
@@ -38,6 +38,8 @@
 resultset_derby.properties
 savepointJdbc30_JSR169_app.properties
 savepointJdbc30_JSR169_derby.properties
+savepointJdbc30_XA_app.properties
+savepointJdbc30_XA_derby.properties
 secureUsers.sql
 secureUsers1.sql
 secureUsers1_app.properties

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_JSR169.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_JSR169.java?rev=376296&r1=376295&r2=376296&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_JSR169.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_JSR169.java Thu Feb  9 06:02:18 2006
@@ -22,14 +22,12 @@
 
 import java.sql.Connection;
 import java.sql.DriverManager;
-import java.sql.Savepoint;
 import java.sql.ResultSet;
-import java.sql.Statement;
 import java.sql.SQLException;
-import java.sql.Types;
+import java.sql.Savepoint;
+import java.sql.Statement;
 
 import org.apache.derby.tools.ij;
-import org.apache.derby.tools.JDBCDisplayUtil;
 import org.apache.derbyTesting.functionTests.util.TestUtil;
 /**
  * Test the new class Savepoint in jdbc 30.
@@ -50,7 +48,7 @@
 
 
 	public static void main(String[] args) {
-		Connection con = null, con2 = null, con3 = null;
+		Connection con = null, con2 = null;
 		Statement  s;
 		System.out.println("Test savepointJdbc30 starting");
 
@@ -60,40 +58,12 @@
 			// make the initial connection.
 			ij.getPropertyArg(args);
 			con = ij.startJBMS();
-			isDerbyNet = TestUtil.isNetFramework();
-
-			con.setAutoCommit(true); // make sure it is true
-			s = con.createStatement();
 			con2 = ij.startJBMS();
-			con2.setAutoCommit(false);
-			/* Create the table and do any other set-up */
-			setUpTest(s);
-
-			//JCC translates the JDBC savepoint calls into equivalent SQL statements.
-			//In addition, we do not allow nested savepoints when
-			//coming through SQL statements. Because of this restriction, we can't run most of the
-			//JDBC savepoint tests under DRDA framework. The JDBC tests have nested JDBC savepoint
-			//calls and they fail when run under JCC(because they get translated into nested SQL savepoints).
-			//Hence, splitting the test cases into non-DRDA and more generic tests.
-			System.out.println("Tests common to DRDA and embedded Cloudscape");
-			genericTests(con, con2, s);
-
-			System.out.println("Next try non-DRDA tests");
-			if (!isDerbyNet)
-				nonDRDATests(con, s);
-
-			s.close();
+			runTests("regular connections", con,con2);
+			
 			con.close();
 			con2.close();
 
-			con3 = ij.startJBMS();
-			con3.setAutoCommit(true);
-			s = con3.createStatement();
-			TestUtil.cleanUpTest(s, testObjects);
-			s.close();
-			con3.close();
-
-
 		}
 		catch (SQLException e) {
 			dumpSQLExceptions(e);
@@ -103,9 +73,44 @@
 			e.printStackTrace(System.out);
 		}
 
-		System.out.println("Test savepointJdbc30 finished");
+	
 	}
 
+public static void runTests(String tag, Connection con, Connection con2) 
+throws SQLException {
+	
+	Statement  s;
+	System.out.println("Test savepointJdbc30 starting for "  + tag);
+	isDerbyNet = TestUtil.isNetFramework();
+	con.setAutoCommit(true); // make sure it is true
+	con2.setAutoCommit(false);
+	s = con.createStatement();
+
+	/* Create the table and do any other set-up */
+	setUpTest(s);
+
+	//JCC translates the JDBC savepoint calls into equivalent SQL statements.
+	//In addition, we do not allow nested savepoints when
+	//coming through SQL statements. Because of this restriction, we can't run most of the
+	//JDBC savepoint tests under DRDA framework. The JDBC tests have nested JDBC savepoint
+	//calls and they fail when run under JCC(because they get translated into nested SQL savepoints).
+	//Hence, splitting the test cases into non-DRDA and more generic tests.
+	System.out.println("Tests common to DRDA and embedded Cloudscape");
+	genericTests(con, con2, s);
+
+	System.out.println("Next try non-DRDA tests");
+	if (!isDerbyNet)
+		nonDRDATests(con, s);
+
+	
+	con.setAutoCommit(true);
+	TestUtil.cleanUpTest(s, testObjects);
+	
+	s.close();
+	
+	}
+
+
 	//The following tests have nested savepoints through JDBC calls. When coming through JCC,
 	//these nested JDBC savepoint calls are translated into equivalent SQL savepoint statements.
 	//But we do not allow nested savepoints coming through SQL statments
@@ -946,7 +951,7 @@
 		s.executeUpdate("insert into t2 values(1)");
 	}
 
-	static private void dumpSQLExceptions (SQLException se) {
+	 public static void dumpSQLExceptions (SQLException se) {
 		System.out.println("FAIL -- unexpected exception");
 		while (se != null) {
 			System.out.print("SQLSTATE("+se.getSQLState()+"):");

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_XA.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_XA.java?rev=376296&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_XA.java (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_XA.java Thu Feb  9 06:02:18 2006
@@ -0,0 +1,75 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.savepointJdbc30_XA.java
+
+   Copyright 2002, 2004 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 java.sql.Connection;
+import java.sql.Savepoint;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.util.Properties;
+
+import javax.sql.XADataSource;
+
+import org.apache.derby.tools.ij;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
+/**
+ * Additional savepoint tests not available with J2ME for connections
+ * obtained from XADataSource (DERBY-898/DERBY-899)
+ */
+
+
+public class savepointJdbc30_XA  extends savepointJdbc30_JSR169{
+
+
+
+	public static void main(String[] args) {
+		Connection con = null, con2 = null;
+	    // Check savepoints for local transactions for
+		// connections fromXADataSource	    
+	    
+	    try {
+	    // Get a connection just to set up the environment with the properties
+	    ij.getPropertyArg(args);	
+	    ij.startJBMS().close();
+		// Test connections obtained via XADataSource DERBY-898/899
+		Properties dsprops = new Properties();
+		dsprops.setProperty("databaseName","wombat");
+		XADataSource ds  = TestUtil.getXADataSource(dsprops);
+		con = ds.getXAConnection().getConnection();
+		con2 = ds.getXAConnection().getConnection();
+		
+		runTests("connections from XADataSource (local tranasaction)", 
+				 con, con2);
+		con.close();
+		con2.close();
+	    }
+		catch (SQLException e) {
+		    dumpSQLExceptions(e);
+				}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:");
+			e.printStackTrace(System.out);
+		}
+
+	}
+}

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

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_XA_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_XA_app.properties?rev=376296&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_XA_app.properties (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_XA_app.properties Thu Feb  9 06:02:18 2006
@@ -0,0 +1,5 @@
+runwithfoundation=false
+runwithj9=false
+runwithjdk13=false
+runwithibm13=false
+usedefaults=true

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

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_XA_derby.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_XA_derby.properties?rev=376296&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_XA_derby.properties (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30_XA_derby.properties Thu Feb  9 06:02:18 2006
@@ -0,0 +1,3 @@
+#there is a lock time out test case, setting waittimeout to lower value for that
+derby.infolog.append=true
+derby.locks.waitTimeout=4

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