Skip to content

Commit

Permalink
cleanup the close derby database method a bit. it seems to work.
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Aug 9, 2008
1 parent 274c7a5 commit 879bd6a
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -101,6 +101,15 @@ public static void cleanup() throws Exception {
rootServer = null;
}

closeDerbyAndReloadDriver();
}

/**
* Unit tests were failing after opening and closing several data connection pools against the
* same database in memory. After shutting down the connection pool, it seems to help by shutting
* down the entire database.
*/
protected static void closeDerbyAndReloadDriver() throws SQLException {
try {
DriverManager.getConnection("jdbc:derby:;shutdown=true");
} catch (SQLException ex) {
Expand All @@ -111,7 +120,6 @@ public static void cleanup() throws Exception {
} catch (Exception ex) {
// derby not in use ...
}

}

public static void setup(String testPrefix, String sqlScriptSuffix, String clientDb, String rootDb)
Expand Down

0 comments on commit 879bd6a

Please sign in to comment.