提交 277f2643 authored 作者: Thomas Mueller's avatar Thomas Mueller

The DbStarter now closes all connections to the configured database

上级 945c201f
......@@ -69,14 +69,20 @@ public class DbStarter implements ServletContextListener {
}
public void contextDestroyed(ServletContextEvent servletContextEvent) {
if (server != null) {
server.stop();
server = null;
try {
conn.createStatement().execute("SHUTDOWN");
} catch (Exception e) {
e.printStackTrace();
}
try {
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
if (server != null) {
server.stop();
server = null;
}
}
}
......@@ -234,6 +234,10 @@ class WebSession {
return shutdownServerOnDisconnect;
}
/**
* Close the connection and stop the statement if one is currently
* executing.
*/
void close() {
if (executingStatement != null) {
try {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论