提交 8d894677 authored 作者: Thomas Mueller's avatar Thomas Mueller

Multi-version concurrency: SELECT ... FOR UPDATE threw a "concurrent update"…

Multi-version concurrency: SELECT ... FOR UPDATE threw a "concurrent update" exception immediately instead of a "lock timeout" exception after the set lock timeout if the row was already locked by another connection.
上级 48932ae2
......@@ -170,7 +170,6 @@ public abstract class Command implements CommandInterface {
Object sync = database.isMultiThreaded() ? (Object) session : (Object) database;
session.waitIfExclusiveModeEnabled();
synchronized (sync) {
database.checkPowerOff();
session.setCurrentCommand(this);
try {
while (true) {
......@@ -250,7 +249,7 @@ public abstract class Command implements CommandInterface {
throw e;
}
long now = System.currentTimeMillis();
if (now - start > session.getLockTimeout()) {
if (start != 0 && now - start > session.getLockTimeout()) {
throw DbException.get(ErrorCode.LOCK_TIMEOUT_1, e.getCause(), "");
}
try {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论