提交 1ecb2f8c authored 作者: noelgrandin@gmail.com's avatar noelgrandin@gmail.com

Fix bug which could generate deadlocks when multiple connections accessed the same table.

上级 0d81945f
......@@ -35,6 +35,7 @@ Change Log
</li><li>Issue 581: When running in LOCK_MODE=0,
JdbcDatabaseMetaData#supportsTransactionIsolationLevel(TRANSACTION_READ_UNCOMMITTED)
should return false
</li><li>Fix bug which could generate deadlocks when multiple connections accessed the same table.
</li></ul>
<h2>Version 1.4.182 Beta (2014-10-17)</h2>
......
......@@ -117,6 +117,9 @@ public class MVTable extends TableBase {
return true;
}
synchronized (getLockSyncObject()) {
if (!exclusive && lockSharedSessions.contains(session)) {
return true;
}
session.setWaitForLock(this, Thread.currentThread());
waitingSessions.addLast(session);
try {
......
......@@ -463,6 +463,9 @@ public class RegularTable extends TableBase {
if (lockExclusiveSession == session) {
return true;
}
if (!exclusive && lockSharedSessions.contains(session)) {
return true;
}
session.setWaitForLock(this, Thread.currentThread());
waitingSessions.addLast(session);
try {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论