Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 62919 invoked from network); 12 Sep 2007 12:35:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Sep 2007 12:35:44 -0000 Received: (qmail 90549 invoked by uid 500); 12 Sep 2007 12:35:38 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 90473 invoked by uid 500); 12 Sep 2007 12:35:38 -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 90462 invoked by uid 99); 12 Sep 2007 12:35:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Sep 2007 05:35:38 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Sep 2007 12:35:44 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id CF1B11A9832; Wed, 12 Sep 2007 05:35:23 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r574917 - in /db/derby/code/branches/10.3/java: engine/org/apache/derby/impl/jdbc/EmbedConnection.java testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DboPowersTest.java Date: Wed, 12 Sep 2007 12:35:23 -0000 To: derby-commits@db.apache.org From: dag@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20070912123523.CF1B11A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dag Date: Wed Sep 12 05:35:22 2007 New Revision: 574917 URL: http://svn.apache.org/viewvc?rev=574917&view=rev Log: DERBY-3038 SYSCS_IMPORT_TABLE FAILS with No current connection after shutdown/reconnect to encrypted database : 10.3.1.4 regression Patch DERBY-3038-2 merged from trunk as: svn merge -r 574732:574733 https://svn.apache.org/repos/asf/db/derby/code/trunk/ All regression tests passed. Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DboPowersTest.java Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java?rev=574917&r1=574916&r2=574917&view=diff ============================================================================== --- db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java (original) +++ db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java Wed Sep 12 05:35:22 2007 @@ -326,6 +326,7 @@ tr = new TransactionResourceImpl(driver, url, info); active = true; setupContextStack(); + context = pushConnectionContext(tr.getContextManager()); if (!bootDatabase(info, false)) { Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DboPowersTest.java URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DboPowersTest.java?rev=574917&r1=574916&r2=574917&view=diff ============================================================================== --- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DboPowersTest.java (original) +++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DboPowersTest.java Wed Sep 12 05:35:22 2007 @@ -22,6 +22,7 @@ package org.apache.derbyTesting.functionTests.tests.jdbcapi; import java.sql.SQLException; +import java.sql.Connection; import javax.sql.DataSource; import junit.framework.Test; import junit.framework.TestSuite; @@ -445,8 +446,9 @@ JDBCDataSource.setBeanProperty(ds, "user", user); JDBCDataSource.setBeanProperty(ds, "password", password); + Connection con = null; try { - ds.getConnection(); + con = ds.getConnection(); vetEncryptionAttempt(user, null); } catch (SQLException e) { vetEncryptionAttempt(user, e); @@ -454,6 +456,12 @@ return; } + try { + derby3038(con); + } catch (SQLException e) { + fail("derby3038 regression: " + e); + } + // we managed to encrypt: bring db down and up again to verify bringDbDown(); bringDbUp(bootPassword); @@ -752,5 +760,36 @@ fail("test error: invalid authLevel: " + _authLevel); break; } + } + + + /** + * Make and call a stored procedure which opens a nested + * connection to expose DERBY-3038. + */ + private void derby3038(Connection con) throws SQLException { + + java.sql.Statement s = con.createStatement(); + + try { + s.executeUpdate + ("CREATE PROCEDURE DERBY3038PROC () " + + "LANGUAGE JAVA PARAMETER STYLE JAVA EXTERNAL NAME '" + + DboPowersTest.class.getName() + ".derby3038Proc' " + + "READS SQL DATA"); + s.executeUpdate("CALL DERBY3038PROC()"); + } finally { + s.close(); + } + } + + + public static void derby3038Proc() + throws SQLException { + + // Before fixing DERNY-3038 this connect would fail. + Connection con = java.sql.DriverManager. + getConnection("jdbc:default:connection"); + con.close(); } }