Commit b456e649 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Shutdown embedded database.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@809 b35dd754-fafc-0310-a699-88a17e54d16e
parent e84be7ff
...@@ -115,13 +115,30 @@ public class EmbeddedConnectionProvider implements ConnectionProvider { ...@@ -115,13 +115,30 @@ public class EmbeddedConnectionProvider implements ConnectionProvider {
} }
public void destroy() { public void destroy() {
if (connectionPool != null) { if (connectionPool == null) {
try { return;
connectionPool.destroy(); }
} // Shutdown the database.
catch (Exception e) { Connection con = null;
Log.error(e); try {
} con = getConnection();
Statement stmt = con.createStatement();
stmt.execute("SHUTDOWN");
stmt.close();
}
catch (SQLException sqle) {
Log.error(sqle);
}
finally {
try { if (con != null) { con.close(); } }
catch (Exception e) { Log.error(e); }
}
// Close the connection pool.
try {
connectionPool.destroy();
}
catch (Exception e) {
Log.error(e);
} }
// Release reference to connectionPool // Release reference to connectionPool
connectionPool = null; connectionPool = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment