db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
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 GMT
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;



Mime
View raw message