提交 68a0ed13 authored 作者: Thomas Mueller's avatar Thomas Mueller

With the MVStore option, when using multiple threads that concurrently create…

With the MVStore option, when using multiple threads that concurrently create indexes or tables, it was relatively easy to get a lock timeout on the "SYS" table.
上级 76c45fe4
...@@ -122,8 +122,10 @@ public class Analyze extends DefineCommand { ...@@ -122,8 +122,10 @@ public class Analyze extends DefineCommand {
// (which is the case if we are within a trigger) // (which is the case if we are within a trigger)
// then we can't update the statistics because // then we can't update the statistics because
// that would unlock all locked objects // that would unlock all locked objects
db.updateMeta(sysSession, table); synchronized (db) {
sysSession.commit(true); db.updateMeta(sysSession, table);
sysSession.commit(true);
}
} }
} }
} }
......
...@@ -104,8 +104,10 @@ public class AlterSequence extends SchemaCommand { ...@@ -104,8 +104,10 @@ public class AlterSequence extends SchemaCommand {
// would keep other transactions from using the sequence // would keep other transactions from using the sequence
Session sysSession = db.getSystemSession(); Session sysSession = db.getSystemSession();
synchronized (sysSession) { synchronized (sysSession) {
db.updateMeta(sysSession, sequence); synchronized (db) {
sysSession.commit(true); db.updateMeta(sysSession, sequence);
sysSession.commit(true);
}
} }
return 0; return 0;
} }
......
...@@ -107,8 +107,10 @@ public class Set extends Prepared { ...@@ -107,8 +107,10 @@ public class Set extends Prepared {
database.setCluster(value); database.setCluster(value);
// use the system session so that the current transaction // use the system session so that the current transaction
// (if any) is not committed // (if any) is not committed
addOrUpdateSetting(database.getSystemSession(), name, value, 0); synchronized (database) {
database.getSystemSession().commit(true); addOrUpdateSetting(database.getSystemSession(), name, value, 0);
database.getSystemSession().commit(true);
}
break; break;
} }
case SetTypes.COLLATION: { case SetTypes.COLLATION: {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论