Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 21025 invoked from network); 7 Jun 2006 20:02:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Jun 2006 20:02:49 -0000 Received: (qmail 11729 invoked by uid 500); 7 Jun 2006 20:02:49 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 11667 invoked by uid 500); 7 Jun 2006 20:02:49 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 11650 invoked by uid 99); 7 Jun 2006 20:02:48 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jun 2006 13:02:48 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jun 2006 13:02:48 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id ED76F1A983A; Wed, 7 Jun 2006 13:02:27 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r412515 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master/DerbyNetClient/checkDataSource30.out tests/jdbcapi/checkDataSource30.java Date: Wed, 07 Jun 2006 20:02:27 -0000 To: derby-commits@db.apache.org From: kmarsden@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060607200227.ED76F1A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: kmarsden Date: Wed Jun 7 13:02:27 2006 New Revision: 412515 URL: http://svn.apache.org/viewvc?rev=412515&view=rev Log: DERBY-435 Enable checkDataSource.java and checkDataSource30.java tests for fixed bugs. I had attached one more small patch " d435-enable-tests-for-fixed-issues.diff" for trunk to be reviewed/committed. This patch enables the tests for issues which have been already fixed and it marks the remaining excludes in the test with the JIRA issue number. Contributed by Deepa Remesh Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDataSource30.out db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDataSource30.out URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDataSource30.out?rev=412515&r1=412514&r2=412515&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDataSource30.out (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDataSource30.out Wed Jun 7 13:02:27 2006 @@ -677,6 +677,9 @@ Default holdability for a connection is HOLD_CURSORS_OVER_COMMIT CONNECTION(not in xa transaction yet) HOLDABILITY true 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 +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 @@ -712,6 +715,13 @@ Expected SQLException ResultSet not open. Verify that autocommit is OFF. Set connection to hold CONNECTION(held) HOLDABILITY true +CONNECTION(xa) HOLDABILITY false +Expected SQLException(setHoldability) Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a global transaction. +HOLDABLE Statement in global xact false connection warning ResultSetHoldability restricted to ResultSet.CLOSE_CURSORS_AT_COMMIT for a global transaction. +HOLDABLE PreparedStatement in global xact false connection warning ResultSetHoldability restricted to ResultSet.CLOSE_CURSORS_AT_COMMIT for a global transaction. +HOLDABLE CallableStatement in global xact false connection warning ResultSetHoldability restricted to ResultSet.CLOSE_CURSORS_AT_COMMIT for a global transaction. +CONNECTION(held) HOLDABILITY true +PASS XA HOLDABILITY TEST **Test holdability state for: PooledConnection ** PASS: Holdability matches expected holdability:HOLD_CURSORS_OVER_COMMIT ** Test autoCommit state for: PooledConnection** Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java?rev=412515&r1=412514&r2=412515&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java Wed Jun 7 13:02:27 2006 @@ -52,6 +52,13 @@ public class checkDataSource30 extends checkDataSource { + // DERBY-1370 - Embedded and client driver differ in the holdability + // reported inside a global transaction for statements that were created + // with HOLD_CURSORS_OVER_COMMIT outside the transaction + // It looks like embedded behaviour is correct. + private static boolean stmtHoldabilityError = + TestUtil.isDerbyNetClientFramework(); + public static void main(String[] args) throws Exception { checkDataSource30 tester = new checkDataSource30(); @@ -172,13 +179,8 @@ //start a global transaction and default holdability and autocommit will be switched to match Derby XA restrictions xr.start(xid, XAResource.TMNOFLAGS); System.out.println("Notice that autocommit now is " + conn1.getAutoCommit() + " for connection because it is part of the global transaction"); - if (TestUtil.isEmbeddedFramework()) - { - // run only for embedded - // Network XA BUG: getHoldability does not return CLOSE_CURSORS_AT_COMMIT for global transaction - System.out.println("Notice that connection's holdability at this point is CLOSE_CURSORS_AT_COMMIT because it is part of the global transaction"); - System.out.println("CONNECTION(in xa transaction) HOLDABILITY " + (conn1.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT)); - } + System.out.println("Notice that connection's holdability at this point is CLOSE_CURSORS_AT_COMMIT because it is part of the global transaction"); + System.out.println("CONNECTION(in xa transaction) HOLDABILITY " + (conn1.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT)); xr.end(xid, XAResource.TMSUCCESS); conn1.commit(); conn1.close(); @@ -186,11 +188,7 @@ xid = getXid(27, (byte) 21, (byte) 01); xr.start(xid, XAResource.TMNOFLAGS); conn1 = xac.getConnection(); - if (TestUtil.isEmbeddedFramework()) - { - // Network XA BUG: getHoldability in a xa transaction returns true - System.out.println("CONNECTION(in xa transaction) HOLDABILITY " + (conn1.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT)); - } + 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); conn1.rollback(); @@ -279,7 +277,8 @@ System.out.println("STATEMENT(this one was created with default holdability after the global transaction was resumed. Check it's holdability) HOLDABILITY " + (stmtAfterGlobalTransactionResume.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT)); System.out.println("PREPAREDSTATEMENT(this one was created with default holdability after the global transaction was resumed. Check it's holdability) HOLDABILITY " + (prepstmtAfterGlobalTransactionResume.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT)); System.out.println("CALLABLESTATEMENT(this one was created with default holdability after the global transaction was resumed. Check it's holdability) HOLDABILITY " + (callablestmtAfterGlobalTransactionResume.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT)); - if (TestUtil.isEmbeddedFramework()) + // DERBY-1370 + if (! stmtHoldabilityError) { // Network XA BUG gives result set closed rsx.next(); System.out.println("X@3 id " + rsx.getInt(1)); @@ -306,17 +305,6 @@ conn.setHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT); System.out.println("CONNECTION(held) HOLDABILITY " + (conn.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT)); - - if (!TestUtil.isEmbeddedFramework()) - { - // Don't run the rest of the test for client - // Network XA BUG: Client allows set HOLD_CURSORS_OVER_COMMIT - // to be set in a a global transaction on the connection and - // statements - conn.close(); - return; - } - xid = getXid(24, (byte) 21, (byte) 01); xr.start(xid, XAResource.TMNOFLAGS); System.out.println("CONNECTION(xa) HOLDABILITY " + (conn.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT)); @@ -355,23 +343,26 @@ shxa.close(); - // check we can use a holdable statement set up in local mode. - // holdability is downgraded, tested in XATest.java - System.out.println("STATEMENT HOLDABILITY " + (sh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT)); - sh.executeQuery("select id from hold_30").close(); - sh.execute("select id from hold_30"); - sh.getResultSet().close(); - - System.out.println("PREPARED STATEMENT HOLDABILITY " + (psh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT)); - psh.executeQuery().close(); - psh.execute(); - psh.getResultSet().close(); - - System.out.println("CALLABLE STATEMENT HOLDABILITY " + (csh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT)); - csh.executeQuery().close(); - csh.execute(); - csh.getResultSet().close(); - + // check we can use a holdable statement set up in local mode. + // holdability is downgraded, tested in XATest.java + // DERBY-1370 + if(! stmtHoldabilityError) { + System.out.println("STATEMENT HOLDABILITY " + (sh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT)); + sh.executeQuery("select id from hold_30").close(); + sh.execute("select id from hold_30"); + sh.getResultSet().close(); + + System.out.println("PREPARED STATEMENT HOLDABILITY " + (psh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT)); + psh.executeQuery().close(); + psh.execute(); + psh.getResultSet().close(); + + System.out.println("CALLABLE STATEMENT HOLDABILITY " + (csh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT)); + csh.executeQuery().close(); + csh.execute(); + csh.getResultSet().close(); + } + // but an update works sh.executeUpdate("insert into hold_30 values(10, 'init10')");