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 {
}
public void destroy() {
if (connectionPool != null) {
try {
connectionPool.destroy();
}
catch (Exception e) {
Log.error(e);
}
if (connectionPool == null) {
return;
}
// Shutdown the database.
Connection con = null;
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
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