提交 d78c3fbe authored 作者: Nick's avatar Nick

Synchronized on database when unlock tables

上级 57a2c96f
...@@ -923,12 +923,14 @@ public class Session extends SessionWithState { ...@@ -923,12 +923,14 @@ public class Session extends SessionWithState {
} }
} }
if (locks.size() > 0) { if (locks.size() > 0) {
// don't use the enhanced for loop to save memory synchronized (database) {
for (int i = 0, size = locks.size(); i < size; i++) { // don't use the enhanced for loop to save memory
Table t = locks.get(i); for (int i = 0, size = locks.size(); i < size; i++) {
t.unlock(this); Table t = locks.get(i);
t.unlock(this);
}
locks.clear();
} }
locks.clear();
} }
savepoints = null; savepoints = null;
sessionStateChanged = true; sessionStateChanged = true;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论