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 2005/06/22 05:02:55 UTC

svn commit: r191755 - in /incubator/derby/code/trunk/java: engine/org/apache/derby/iapi/jdbc/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/tests/derbynet/ testing/org/apache/derbyTesting/functionTe...

Author: kmarsden
Date: Tue Jun 21 20:02:54 2005
New Revision: 191755

URL: http://svn.apache.org/viewcvs?rev=191755&view=rev
Log:
Fix for 
DERBY-8
Connection object gets created with un-supported holdability on getting Connection object from XAConnection "inside" the global transaction

DERBY-366
In jdk13, when a connection transitions from global transaction to local transaction, its default holdability of HOLD_CURSORS_OVER_COMMIT is not restored.


 have a patch to fix Derby-8 (Connection object gets created with un-supported holdability on getting Connection object from XAConnection "inside" the global transaction) and Derby-366 (In jdk13, when a connection transitions from global transaction to local transaction, its default holdability of HOLD_CURSORS_OVER_COMMIT is not restored.) The patch is attached to both Derby-8 and Derby-366. 

The fix for both these bugs was centered around fixing the holdability handling in BrokeredConnection.java This was because BrokeredConnection.java had no code for restoring the holdability of real connection object and no code for saving the current holdability state of real connection object. I put fix for both these issues in BrokeredConnection.java so that both jdk13 and jdk14+ environments will be handled correctly. Had to use reflection for this holdability work 
because Connection.setHoldability and Connection.getHoldability methods are not available through JDK13 apis. 

					Contributed by Mamta Satoor

Modified:
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection30.java
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkDataSource30.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaAnotherTest.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaOffline1.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaSimpleNegative.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaSimplePositive.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xab2354.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaAnotherTest.sql
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaSimpleNegative.sql
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaSimplePositive.sql
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/xaOffline1.sql
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/xab2354.sql

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java?rev=191755&r1=191754&r2=191755&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java Tue Jun 21 20:02:54 2005
@@ -33,12 +33,21 @@
 import java.io.ObjectOutput;
 import java.io.ObjectInput;
 
+import java.lang.reflect.*;
+
+import org.apache.derby.iapi.reference.JDBC30Translation;
+import org.apache.derby.iapi.error.PublicAPI;
+import org.apache.derby.iapi.error.StandardException;
+
 /**
  * This is a rudimentary connection that delegates
  * EVERYTHING to Connection.
  */
 public class BrokeredConnection implements Connection
 {
+	
+	// default for Derby
+	protected int stateHoldability = JDBC30Translation.HOLD_CURSORS_OVER_COMMIT;
 
 	protected final BrokeredConnectionControl control;
 	private boolean isClosed;
@@ -383,6 +392,15 @@
 		stateIsolationLevel = conn.getTransactionIsolation();
 		stateReadOnly = conn.isReadOnly();
 		stateAutoCommit = conn.getAutoCommit();
+		// jdk13 does not have Connection.getHoldability method and hence using
+		// reflection to cover both jdk13 and higher jdks
+		try {
+			Method sh = conn.getClass().getMethod("getHoldability", null);
+			stateHoldability = ((Integer)sh.invoke(conn, null)).intValue();
+		} catch( Exception e)
+		{
+			throw PublicAPI.wrapStandardException( StandardException.plainWrapException( e));
+		}       
 	}
 
 	/**
@@ -396,6 +414,8 @@
 		
 	*/
 	public void setState(boolean complete) throws SQLException {
+		Class[] CONN_PARAM = { Integer.TYPE };
+		Object[] CONN_ARG = { new Integer(stateHoldability)};
 
 		Connection conn = getRealConnection();
 
@@ -403,6 +423,18 @@
 			conn.setTransactionIsolation(stateIsolationLevel);
 			conn.setReadOnly(stateReadOnly);
 			conn.setAutoCommit(stateAutoCommit);
+			// make the underlying connection pick my holdability state
+			// since holdability is a state of the connection handle
+			// not the underlying transaction.
+			// jdk13 does not have Connection.setHoldability method and hence using
+			// reflection to cover both jdk13 and higher jdks
+			try {
+				Method sh = conn.getClass().getMethod("setHoldability", CONN_PARAM);
+				sh.invoke(conn, CONN_ARG);
+			} catch( Exception e)
+			{
+				throw PublicAPI.wrapStandardException( StandardException.plainWrapException( e));
+			}
 		}
 	}
 

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection30.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection30.java?rev=191755&r1=191754&r2=191755&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection30.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection30.java Tue Jun 21 20:02:54 2005
@@ -32,9 +32,6 @@
  */
 public class BrokeredConnection30 extends BrokeredConnection
 {
-	
-	// default for Cloudscape
-	private int stateHoldability = java.sql.ResultSet.HOLD_CURSORS_OVER_COMMIT;
 
 	public	BrokeredConnection30(BrokeredConnectionControl control)
 	{
@@ -215,19 +212,6 @@
 			notifyException(se);
 			throw se;
 		}
-	}
-	public void syncState() throws SQLException {
-		super.syncState();
-		// make the underlying connection pick my holdability state
-		// since holdability is a state of the connection handle
-		// not the underlying transaction.
-		getRealConnection().setHoldability(stateHoldability);
-	}
-
-	public void setState(boolean complete) throws SQLException {
-		super.setState(complete);
-		if (complete) 
-			getRealConnection().setHoldability(stateHoldability);
 	}
 
 	public BrokeredPreparedStatement newBrokeredStatement(BrokeredStatementControl statementControl, String sql, Object generatedKeys) throws SQLException {

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkDataSource30.out
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkDataSource30.out?rev=191755&r1=191754&r2=191755&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkDataSource30.out (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkDataSource30.out Tue Jun 21 20:02:54 2005
@@ -225,7 +225,7 @@
 EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
 EVENT(5):connectionClosed
 Running JDBC 3.0 connection checks on Global EmbeddedXADataSource
-  holdability     true
+  holdability     false
 JDBC 3.0 savepoint SQL Exception: Cannot rollback a global transaction using the Connection, commit processing must go thru XAResource interface.
 Running connection checks on Global EmbeddedXADataSource
   isolation level 2
@@ -240,7 +240,7 @@
 Global EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
 Global EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
 Running JDBC 3.0 connection checks on Global EmbeddedXADataSource
-  holdability     true
+  holdability     false
 JDBC 3.0 savepoint SQL Exception: Cannot rollback a global transaction using the Connection, commit processing must go thru XAResource interface.
 Running connection checks on Global EmbeddedXADataSource
   isolation level 2
@@ -303,7 +303,7 @@
 Switch to global EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
 Switch to global EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
 Running JDBC 3.0 connection checks on Switch to global EmbeddedXADataSource
-  holdability     true
+  holdability     false
 JDBC 3.0 savepoint SQL Exception: Cannot rollback a global transaction using the Connection, commit processing must go thru XAResource interface.
 Running connection checks on Switch to global EmbeddedXADataSource
   isolation level 2
@@ -361,7 +361,7 @@
   read only       false
 EVENT(6):connectionClosed
 re-join with new handle X1
-  holdability     true
+  holdability     false
   isolation level READ_UNCOMMITTED
   auto commit     false
   read only       true
@@ -372,7 +372,7 @@
   auto commit     true
   read only       false
 pre-X1 commit - X1
-  holdability     true
+  holdability     false
   isolation level READ_UNCOMMITTED
   auto commit     false
   read only       true
@@ -721,9 +721,7 @@
 Notice that autocommit now is false for connection because it is part of the global transaction
 Notice that connection's holdability at this point is CLOSE_CURSORS_AT_COMMIT because it is part of the global transaction
 CONNECTION(in xa transaction) HOLDABILITY false
-This is a bug. Connection's holdability should have been CLOSE_CURSORS_AT_COMMIT since it is in the global transaction
-Have reported this on Derby dev-list
-CONNECTION(in xa transaction) HOLDABILITY true
+CONNECTION(in xa transaction) HOLDABILITY false
 Autocommit on Connection inside global transaction has been set correctly to false
 CONNECTION(non-xa) HOLDABILITY false
 STATEMENT HOLDABILITY false

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaAnotherTest.out
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaAnotherTest.out?rev=191755&r1=191754&r2=191755&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaAnotherTest.out (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaAnotherTest.out Tue Jun 21 20:02:54 2005
@@ -6,12 +6,6 @@
 xa_connect ;
 ij> xa_start xa_noflags 0;
 ij> xa_getconnection;
-ij> -- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 ij> drop table APP.foo;
 ERROR 42Y55: 'DROP TABLE' cannot be performed on 'APP.FOO' because it does not exist.
 ij> create table APP.foo (a int);
@@ -48,12 +42,6 @@
 ij> -- global connection 1
 xa_start xa_noflags 1;
 ij> xa_getconnection;
-ij> -- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 ij> insert into APP.foo values (1);
 1 row inserted/updated/deleted
 ij> xa_end xa_suspend 1;
@@ -155,12 +143,6 @@
 ij(LOCAL2)> -- add couple more global transactions
 xa_start xa_noflags 6;
 ij(LOCAL2)> xa_getconnection;
-ij(XA)> -- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 ij(XA)> insert into APP.foo values (6);
 1 row inserted/updated/deleted
 ij(XA)> xa_end xa_suspend 6;

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaOffline1.out
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaOffline1.out?rev=191755&r1=191754&r2=191755&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaOffline1.out (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaOffline1.out Tue Jun 21 20:02:54 2005
@@ -6,12 +6,6 @@
 xa_connect ;
 ij> xa_start xa_noflags 0;
 ij> xa_getconnection;
-ij(XA)> -- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 ij(XA)> drop table foo;
 ERROR 42Y55: 'DROP TABLE' cannot be performed on 'FOO' because it does not exist.
 ij(XA)> create table foo (a int);
@@ -140,12 +134,6 @@
 IJ ERROR: XAER_DUPID 
 ij(XA)> xa_start xa_noflags 4;
 ij(XA)> xa_getconnection;
-ij(XA)> -- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 ij(XA)> select * from global_xactTable where gxid is not null order by gxid;
 GXID|STATUS  |READ&|USERNAME  |TYPE                          
 -------------------------------------------------------------

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaSimpleNegative.out
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaSimpleNegative.out?rev=191755&r1=191754&r2=191755&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaSimpleNegative.out (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaSimpleNegative.out Tue Jun 21 20:02:54 2005
@@ -9,12 +9,6 @@
 xa_start xa_noflags 1;
 IJ ERROR: XAER_PROTO 
 ij> xa_getconnection;
-ij(XA)> -- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 ij(XA)> -- ERROR: cannot get connection again
 xa_getconnection;
 ERROR XJ059: Cannot close a connection while a global transaction is still active.
@@ -99,12 +93,6 @@
 IJ ERROR: XA_RBROLLBACK 
 ij> xa_start xa_noflags 2;
 ij> xa_getconnection;
-ij(XA)> -- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 ij(XA)> insert into APP.negative values ('ok', 3);
 1 row inserted/updated/deleted
 ij(XA)> -- ERROR: cannot suspend some other xid
@@ -137,12 +125,6 @@
 ij> -- this is OK
 xa_start xa_join 2;
 ij> xa_getconnection;
-ij(XA)> -- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 ij(XA)> -- ERROR: another dup 
 insert into APP.negative values ('rollback', 3);
 ERROR 23505: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'NEGATIVEI' defined on 'NEGATIVE'.
@@ -196,12 +178,6 @@
 ij(XA)> disconnect;
 ij> xa_start xa_noflags 3;
 ij> xa_getconnection;
-ij(XA)> -- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 ij(XA)> select * from global_xactTable order by gxid, status, username, type;
 GXID|STATUS  |READ&|USERNAME  |TYPE                          
 -------------------------------------------------------------

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaSimplePositive.out
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaSimplePositive.out?rev=191755&r1=191754&r2=191755&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaSimplePositive.out (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaSimplePositive.out Tue Jun 21 20:02:54 2005
@@ -5,12 +5,6 @@
 xa_connect ;
 ij> xa_start xa_noflags 0;
 ij> xa_getconnection;
-ij(XA)> -- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 ij(XA)> drop table foo;
 ERROR 42Y55: 'DROP TABLE' cannot be performed on 'FOO' because it does not exist.
 ij(XA)> create table foo (a int);
@@ -46,12 +40,6 @@
 ij(XA)> xa_connect user 'sku' password 'testxa' ;
 ij(XA)> xa_start xa_noflags 1;
 ij(XA)> xa_getconnection;
-ij(XA)> -- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 ij(XA)> insert into APP.foo values (1);
 1 row inserted/updated/deleted
 ij(XA)> xa_end xa_suspend 1;
@@ -148,12 +136,6 @@
 3          
 ij(LOCAL)> xa_start xa_resume 4;
 ij(LOCAL)> xa_getconnection;
-ij(XA)> -- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 ij(XA)> insert into APP.foo values (4);
 1 row inserted/updated/deleted
 ij(XA)> disconnect;
@@ -170,12 +152,6 @@
 --disconnect;
 xa_start xa_resume 5;
 ij(LOCAL)> xa_getconnection;
-ij(XA)> -- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 ij(XA)> insert into APP.foo values (5);
 1 row inserted/updated/deleted
 ij(XA)> xa_end xa_success 5;

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xab2354.out
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xab2354.out?rev=191755&r1=191754&r2=191755&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xab2354.out (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xab2354.out Tue Jun 21 20:02:54 2005
@@ -2,12 +2,6 @@
 ij> xa_connect;
 ij> xa_start xa_noflags 1;
 ij> xa_getconnection;
-ij(XA)> -- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 ij(XA)> create table foo (a int);
 0 rows inserted/updated/deleted
 ij(XA)> insert into foo values (1);

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java?rev=191755&r1=191754&r2=191755&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java Tue Jun 21 20:02:54 2005
@@ -127,8 +127,11 @@
 						   TestUtil.getJdbcUrlPrefix("localhost",
 													 NETWORKSERVER_PORT) +
 						   "wombat;create=true");
-		System.setProperty("ij.user", "EDWARD");
-		System.setProperty("ij.password", "noodle");
+		if (TestUtil.isJCCFramework())
+		{
+			System.setProperty("ij.user", "EDWARD");
+			System.setProperty("ij.password", "noodle");
+		}
 
 	}
 
@@ -186,9 +189,11 @@
 		{
 			attrs.setProperty("driverType","4");
 		}
-
-		attrs.setProperty("serverName","localhost");
-		attrs.setProperty("portNumber","20000");
+		if (TestUtil.isJCCFramework())
+		{
+			attrs.setProperty("serverName","localhost");
+		}
+			attrs.setProperty("portNumber","20000");
 		//attrs.setProperty("retrieveMessagesFromServerOnGetMessage","true");
 		return attrs;
 	}

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java?rev=191755&r1=191754&r2=191755&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java Tue Jun 21 20:02:54 2005
@@ -177,8 +177,6 @@
 			xid = getXid(27, (byte) 21, (byte) 01);
 			xr.start(xid, XAResource.TMNOFLAGS);
 			conn1 = xac.getConnection();
-			System.out.println("This is a bug. Connection's holdability should have been CLOSE_CURSORS_AT_COMMIT since it is in the global transaction");
-			System.out.println("Have reported this on Derby dev-list");
 			System.out.println("CONNECTION(in xa transaction) HOLDABILITY " + (conn1.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
 			System.out.println("Autocommit on Connection inside global transaction has been set correctly to " + conn1.getAutoCommit());
 			xr.end(xid, XAResource.TMSUCCESS);

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaAnotherTest.sql
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaAnotherTest.sql?rev=191755&r1=191754&r2=191755&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaAnotherTest.sql (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaAnotherTest.sql Tue Jun 21 20:02:54 2005
@@ -8,12 +8,6 @@
 xa_connect ;
 xa_start xa_noflags 0;
 xa_getconnection;
--- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 drop table APP.foo;
 create table APP.foo (a int);
 insert into APP.foo values (0);
@@ -34,12 +28,6 @@
 -- global connection 1
 xa_start xa_noflags 1;
 xa_getconnection;
--- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 insert into APP.foo values (1);
 xa_end xa_suspend 1;
 
@@ -128,12 +116,6 @@
 -- add couple more global transactions
 xa_start xa_noflags 6;
 xa_getconnection;
--- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 insert into APP.foo values (6);
 xa_end xa_suspend 6;
 

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaSimpleNegative.sql
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaSimpleNegative.sql?rev=191755&r1=191754&r2=191755&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaSimpleNegative.sql (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaSimpleNegative.sql Tue Jun 21 20:02:54 2005
@@ -11,12 +11,6 @@
 xa_start xa_noflags 1;
 
 xa_getconnection;
--- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 
 -- ERROR: cannot get connection again
 xa_getconnection;
@@ -79,12 +73,6 @@
 
 xa_start xa_noflags 2;
 xa_getconnection;
--- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 
 insert into APP.negative values ('ok', 3);
 
@@ -117,12 +105,6 @@
 -- this is OK
 xa_start xa_join 2;
 xa_getconnection;
--- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 
 -- ERROR: another dup 
 insert into APP.negative values ('rollback', 3);
@@ -178,12 +160,6 @@
 
 xa_start xa_noflags 3;
 xa_getconnection;
--- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 select * from global_xactTable order by gxid, status, username, type;
 drop table foo;
 create table foo (a int);

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaSimplePositive.sql
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaSimplePositive.sql?rev=191755&r1=191754&r2=191755&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaSimplePositive.sql (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaSimplePositive.sql Tue Jun 21 20:02:54 2005
@@ -6,12 +6,6 @@
 xa_connect ;
 xa_start xa_noflags 0;
 xa_getconnection;
--- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 drop table foo;
 create table foo (a int);
 insert into foo values (0);
@@ -31,12 +25,6 @@
 
 xa_start xa_noflags 1;
 xa_getconnection;
--- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 insert into APP.foo values (1);
 xa_end xa_suspend 1;
 
@@ -111,12 +99,6 @@
 
 xa_start xa_resume 4;
 xa_getconnection;
--- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 
 insert into APP.foo values (4);
 disconnect;
@@ -136,12 +118,6 @@
 
 xa_start xa_resume 5;
 xa_getconnection;
--- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 insert into APP.foo values (5);
 xa_end xa_success 5;
 

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/xaOffline1.sql
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/xaOffline1.sql?rev=191755&r1=191754&r2=191755&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/xaOffline1.sql (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/xaOffline1.sql Tue Jun 21 20:02:54 2005
@@ -7,12 +7,6 @@
 xa_connect ;
 xa_start xa_noflags 0;
 xa_getconnection;
--- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 drop table foo;
 create table foo (a int);
 insert into foo values (0);
@@ -70,12 +64,6 @@
 
 xa_start xa_noflags 4;
 xa_getconnection;
--- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 select * from global_xactTable where gxid is not null order by gxid;
 select * from lock_table order by tabname, type desc, mode, cnt, lockname;
 xa_recover xa_startrscan;

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/xab2354.sql
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/xab2354.sql?rev=191755&r1=191754&r2=191755&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/xab2354.sql (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/xab2354.sql Tue Jun 21 20:02:54 2005
@@ -2,12 +2,6 @@
 xa_connect;
 xa_start xa_noflags 1;
 xa_getconnection;
--- Global transactions can not have hold cursor over commit. And hence we need to make sure the holdability is false for all jdks
--- In jdk13 and lower, this Brokered Connection has its holdability false over commit so we are fine. 
--- In jdk14 and higher, this Brokered Connection has its holdability true over commit. In order to set it to false, we have NoHoldForConnection 
--- NoHoldForConnection uses setHoldability api on Connection to set the holdability to false. But this api exists only for jdk14 and higher
--- And that is why, in jkd13 master, we see an exception nosuchmethod 
-NoHoldForConnection;
 create table foo (a int);
 insert into foo values (1);
 xa_end xa_success 1;