提交 0cf61159 authored 作者: Thomas Mueller's avatar Thomas Mueller

Using "runscript" with autocommit disabled could result in a lock timeout on the…

Using "runscript" with autocommit disabled could result in a lock timeout on the internal table "SYS".
上级 38a3055d
...@@ -98,20 +98,21 @@ public class Set extends Prepared { ...@@ -98,20 +98,21 @@ public class Set extends Prepared {
break; break;
} }
String value = StringUtils.quoteStringSQL(stringValue); String value = StringUtils.quoteStringSQL(stringValue);
if (!value.equals(database.getCluster()) && if (!value.equals(database.getCluster())) {
!value.equals(Constants.CLUSTERING_DISABLED)) { if (!value.equals(Constants.CLUSTERING_DISABLED)) {
// anybody can disable the cluster // anybody can disable the cluster
// (if he can't access a cluster node) // (if he can't access a cluster node)
session.getUser().checkAdmin(); session.getUser().checkAdmin();
} }
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
Session sysSession = database.getSystemSession(); Session sysSession = database.getSystemSession();
synchronized (sysSession) { synchronized (sysSession) {
synchronized (database) { synchronized (database) {
addOrUpdateSetting(sysSession, name, value, 0); addOrUpdateSetting(sysSession, name, value, 0);
sysSession.commit(true); sysSession.commit(true);
}
} }
} }
break; break;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论