提交 77a8e194 authored 作者: Thomas Mueller's avatar Thomas Mueller

Small refactoring

上级 520d0657
...@@ -1220,20 +1220,7 @@ public class Database implements DataHandler { ...@@ -1220,20 +1220,7 @@ public class Database implements DataHandler {
} }
closing = true; closing = true;
} }
// remove all session variables removeOrphanedLobs();
if (persistent) {
boolean lobStorageIsUsed = infoSchema.findTableOrView(
systemSession, LobStorageBackend.LOB_DATA_TABLE) != null;
if (lobStorageIsUsed) {
try {
getLobStorage();
lobStorage.removeAllForTable(
LobStorageFrontend.TABLE_ID_SESSION_VARIABLE);
} catch (DbException e) {
trace.error(e, "close");
}
}
}
try { try {
if (systemSession != null) { if (systemSession != null) {
if (powerOffCount != -1) { if (powerOffCount != -1) {
...@@ -1299,6 +1286,26 @@ public class Database implements DataHandler { ...@@ -1299,6 +1286,26 @@ public class Database implements DataHandler {
} }
} }
private void removeOrphanedLobs() {
// remove all session variables and temporary lobs
if (!persistent) {
return;
}
boolean lobStorageIsUsed = infoSchema.findTableOrView(
systemSession, LobStorageBackend.LOB_DATA_TABLE) != null;
lobStorageIsUsed |= mvStore != null;
if (!lobStorageIsUsed) {
return;
}
try {
getLobStorage();
lobStorage.removeAllForTable(
LobStorageFrontend.TABLE_ID_SESSION_VARIABLE);
} catch (DbException e) {
trace.error(e, "close");
}
}
private void stopWriter() { private void stopWriter() {
if (writer != null) { if (writer != null) {
writer.stopThread(); writer.stopThread();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论