提交 424af0db authored 作者: Noel Grandin's avatar Noel Grandin 提交者: GitHub

Merge pull request #561 from andreitokar/issue#560

Issue#560 thread leak
......@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论