提交 fa02cecf authored 作者: andrei's avatar andrei

Issue#560 thread leak

上级 5831e75e
......@@ -292,14 +292,16 @@ public class Database implements DataHandler {
if (e instanceof OutOfMemoryError) {
e.fillInStackTrace();
}
boolean alreadyOpen = e instanceof DbException
&& ((DbException)e).getErrorCode() == ErrorCode.DATABASE_ALREADY_OPEN_1;
if (alreadyOpen) {
stopServer();
}
if (traceSystem != null) {
if (e instanceof SQLException) {
SQLException e2 = (SQLException) e;
if (e2.getErrorCode() != ErrorCode.
DATABASE_ALREADY_OPEN_1) {
// only write if the database is not already in use
trace.error(e, "opening {0}", databaseName);
}
if (e instanceof DbException && !alreadyOpen) {
// only write if the database is not already in use
trace.error(e, "opening {0}", databaseName);
}
traceSystem.close();
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论