Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 91788 invoked from network); 10 Oct 2010 18:25:12 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 10 Oct 2010 18:25:12 -0000 Received: (qmail 66364 invoked by uid 500); 10 Oct 2010 18:25:12 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 66334 invoked by uid 500); 10 Oct 2010 18:25:11 -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 66327 invoked by uid 99); 10 Oct 2010 18:25:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Oct 2010 18:25:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Oct 2010 18:25:09 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B3D142388993; Sun, 10 Oct 2010 18:24:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1006332 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LargeDataLocksTest.java Date: Sun, 10 Oct 2010 18:24:47 -0000 To: derby-commits@db.apache.org From: kahatlen@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101010182447.B3D142388993@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kahatlen Date: Sun Oct 10 18:24:47 2010 New Revision: 1006332 URL: http://svn.apache.org/viewvc?rev=1006332&view=rev Log: DERBY-4825: Assert failure in LargeDataLocksTest.testGetCharacterStream() because of wrong number of locks Wait for background thread to complete post-commit work before counting the locks, so that the locks it obtains don't intermittently show up in the lock table. Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LargeDataLocksTest.java Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LargeDataLocksTest.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LargeDataLocksTest.java?rev=1006332&r1=1006331&r2=1006332&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LargeDataLocksTest.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LargeDataLocksTest.java Sun Oct 10 18:24:47 2010 @@ -150,6 +150,11 @@ public class LargeDataLocksTest extends // make the default connection auto-commit and release locks. Connection conn = openDefaultConnection(); Statement stmt = conn.createStatement(); + + // First wait for post-commit work to complete so that we don't count + // locks held by the background worker thread. + stmt.execute("call wait_for_post_commit()"); + ResultSet rs = stmt.executeQuery("select * from syscs_diag.lock_table"); ResultSetMetaData meta = rs.getMetaData(); @@ -210,6 +215,16 @@ public class LargeDataLocksTest extends ps.setInt(3, 38000); ps.executeUpdate(); ps.close(); + + // Create a procedure for use by assertLockCount() to ensure + // that the background worker thread has completed all the + // post-commit work. + s.execute("CREATE PROCEDURE WAIT_FOR_POST_COMMIT() " + + "LANGUAGE JAVA EXTERNAL NAME " + + "'org.apache.derbyTesting.functionTests.util." + + "T_Access.waitForPostCommitToFinish' " + + "PARAMETER STYLE JAVA"); + conn.commit(); } };