提交 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 { ...@@ -170,7 +170,6 @@ public abstract class Command implements CommandInterface {
Object sync = database.isMultiThreaded() ? (Object) session : (Object) database; Object sync = database.isMultiThreaded() ? (Object) session : (Object) database;
session.waitIfExclusiveModeEnabled(); session.waitIfExclusiveModeEnabled();
synchronized (sync) { synchronized (sync) {
database.checkPowerOff();
session.setCurrentCommand(this); session.setCurrentCommand(this);
try { try {
while (true) { while (true) {
...@@ -250,7 +249,7 @@ public abstract class Command implements CommandInterface { ...@@ -250,7 +249,7 @@ public abstract class Command implements CommandInterface {
throw e; throw e;
} }
long now = System.currentTimeMillis(); 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(), ""); throw DbException.get(ErrorCode.LOCK_TIMEOUT_1, e.getCause(), "");
} }
try { try {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论