提交 657758aa authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Use ConnectionInfo.getProperty(String, boolean) in SessionRemote

上级 9ab420f0
...@@ -333,7 +333,7 @@ public class ConnectionInfo implements Cloneable { ...@@ -333,7 +333,7 @@ public class ConnectionInfo implements Cloneable {
* @param defaultValue the default value * @param defaultValue the default value
* @return the value * @return the value
*/ */
boolean getProperty(String key, boolean defaultValue) { public boolean getProperty(String key, boolean defaultValue) {
return Utils.parseBoolean(getProperty(key, null), defaultValue, false); return Utils.parseBoolean(getProperty(key, null), defaultValue, false);
} }
......
...@@ -335,8 +335,7 @@ public class SessionRemote extends SessionWithState implements DataHandler { ...@@ -335,8 +335,7 @@ public class SessionRemote extends SessionWithState implements DataHandler {
} }
// create the session using reflection, // create the session using reflection,
// so that the JDBC layer can be compiled without it // so that the JDBC layer can be compiled without it
boolean autoServerMode = Boolean.parseBoolean( boolean autoServerMode = ci.getProperty("AUTO_SERVER", false);
ci.getProperty("AUTO_SERVER", "false"));
ConnectionInfo backup = null; ConnectionInfo backup = null;
try { try {
if (autoServerMode) { if (autoServerMode) {
...@@ -413,11 +412,9 @@ public class SessionRemote extends SessionWithState implements DataHandler { ...@@ -413,11 +412,9 @@ public class SessionRemote extends SessionWithState implements DataHandler {
serverList = StringUtils.quoteStringSQL(server); serverList = StringUtils.quoteStringSQL(server);
ci.setProperty("CLUSTER", Constants.CLUSTERING_ENABLED); ci.setProperty("CLUSTER", Constants.CLUSTERING_ENABLED);
} }
autoReconnect = Boolean.parseBoolean(ci.getProperty( autoReconnect = ci.getProperty("AUTO_RECONNECT", false);
"AUTO_RECONNECT", "false"));
// AUTO_SERVER implies AUTO_RECONNECT // AUTO_SERVER implies AUTO_RECONNECT
boolean autoServer = Boolean.parseBoolean(ci.getProperty( boolean autoServer = ci.getProperty("AUTO_SERVER", false);
"AUTO_SERVER", "false"));
if (autoServer && serverList != null) { if (autoServer && serverList != null) {
throw DbException throw DbException
.getUnsupportedException("autoServer && serverList != null"); .getUnsupportedException("autoServer && serverList != null");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论