From derby-commits-return-14520-apmail-db-derby-commits-archive=db.apache.org@db.apache.org Tue Jun 14 09:27:17 2011 Return-Path: X-Original-To: apmail-db-derby-commits-archive@www.apache.org Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 654FF63DF for ; Tue, 14 Jun 2011 09:27:17 +0000 (UTC) Received: (qmail 40503 invoked by uid 500); 14 Jun 2011 09:27:17 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 40475 invoked by uid 500); 14 Jun 2011 09:27:17 -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 40468 invoked by uid 99); 14 Jun 2011 09:27:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jun 2011 09:27:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Tue, 14 Jun 2011 09:27:14 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D0D4323889EC; Tue, 14 Jun 2011 09:26:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1135432 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/PhaseChanger.java Date: Tue, 14 Jun 2011 09:26:53 -0000 To: derby-commits@db.apache.org From: kahatlen@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110614092653.D0D4323889EC@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kahatlen Date: Tue Jun 14 09:26:53 2011 New Revision: 1135432 URL: http://svn.apache.org/viewvc?rev=1135432&view=rev Log: DERBY-5267: Shut down engine for old versions in upgrade tests to save memory Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/PhaseChanger.java Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/PhaseChanger.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/PhaseChanger.java?rev=1135432&r1=1135431&r2=1135432&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/PhaseChanger.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/PhaseChanger.java Tue Jun 14 09:26:53 2011 @@ -118,42 +118,15 @@ final class PhaseChanger extends BaseTes } /** - * Shutdown the database(s) and reset the class loader. - * @throws InterruptedException + * Shutdown the database engine and reset the class loader. + * @throws SQLException if the engine couldn't be stopped */ - protected void tearDown() throws InterruptedException + protected void tearDown() throws SQLException { if ( trace ) BaseTestCase.traceit(" Test upgrade done."); - if (phase != UpgradeChange.PH_POST_HARD_UPGRADE) { - DataSource ds = JDBCDataSource.getDataSource(); - JDBCDataSource.shutdownDatabase(ds); + DataSource ds = JDBCDataSource.getDataSource(); + JDBCDataSource.shutEngine(ds); - for (int i = 0; i < UpgradeRun.ADDITIONAL_DBS.length; i++) - { - ds = JDBCDataSource.getDataSourceLogical( - UpgradeRun.ADDITIONAL_DBS[i].logicalName); - - if (UpgradeRun.ADDITIONAL_DBS[i].shutDown) { - boolean shutdown = true; - try { - ds.getConnection().close(); - } catch (SQLException e) { - // if the database was never created - // don't bother shutting it down - String sqlState = e.getSQLState(); - if ("XJ004".equals(sqlState) || - "XJ040".equals(sqlState)) { - shutdown = false; - } - } - - if (shutdown) - JDBCDataSource.shutdownDatabase(ds); - } // else done by test - } - } - - if (loader != null) UpgradeClassLoader.setThreadLoader(previousLoader); loader = null;