提交 3e4c4489 authored 作者: Noel Grandin's avatar Noel Grandin

fix abba deadlock in Sequence.flushInternal

after my previous commit which removed the use of the system session. Since we are taking the meta lock here, we don't need any extra synchronization
上级 f2e6dd8e
......@@ -32,7 +32,6 @@ public class Sequence extends SchemaObjectBase {
private long maxValue;
private boolean cycle;
private boolean belongsToTable;
private final Object flushSync = new Object();
private boolean writeWithMargin;
/**
......@@ -306,18 +305,16 @@ public class Sequence extends SchemaObjectBase {
}
private void flushInternal(Session session) {
synchronized (flushSync) {
final boolean metaWasLocked = database.lockMeta(session);
// just for this case, use the value with the margin
try {
writeWithMargin = true;
database.updateMeta(session, this);
} finally {
writeWithMargin = false;
}
if (!metaWasLocked) {
database.unlockMeta(session);
}
final boolean metaWasLocked = database.lockMeta(session);
// just for this case, use the value with the margin
try {
writeWithMargin = true;
database.updateMeta(session, this);
} finally {
writeWithMargin = false;
}
if (!metaWasLocked) {
database.unlockMeta(session);
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论