This is an automated email from the ASF dual-hosted git repository.

jiangmaolin pushed a commit to branch dev-5.5.1
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git

commit 720f93bb4d864424608f0cf0a412b84eabe8a779
Author: jiangML <[email protected]>
AuthorDate: Fri Nov 1 12:19:40 2024 +0800

    Update the default value of instance-connection-enabled to true
---
 .../config/props/temporary/TemporaryConfigurationPropertyKey.java     | 2 +-
 .../apache/shardingsphere/mode/metadata/MetaDataContextsFactory.java  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/temporary/TemporaryConfigurationPropertyKey.java
 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/temporary/TemporaryConfigurationPropertyKey.java
index 10c90eb4f86..d73cf357381 100644
--- 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/temporary/TemporaryConfigurationPropertyKey.java
+++ 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/temporary/TemporaryConfigurationPropertyKey.java
@@ -71,7 +71,7 @@ public enum TemporaryConfigurationPropertyKey implements 
TypedPropertyKey {
      * Instance connection enabled.
      */
     @SphereEx
-    INSTANCE_CONNECTION_ENABLED("instance-connection-enabled", 
String.valueOf(Boolean.FALSE), boolean.class, false),
+    INSTANCE_CONNECTION_ENABLED("instance-connection-enabled", 
String.valueOf(Boolean.TRUE), boolean.class, false),
     
     @SphereEx
     DROP_CURRENT_USER_ENABLED("drop-current-user-enabled", 
String.valueOf(Boolean.TRUE), boolean.class, false);
diff --git 
a/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/MetaDataContextsFactory.java
 
b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/MetaDataContextsFactory.java
index 54e2a54980d..fdcfe96fdf6 100644
--- 
a/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/MetaDataContextsFactory.java
+++ 
b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/MetaDataContextsFactory.java
@@ -30,6 +30,7 @@ import 
org.apache.shardingsphere.infra.config.database.DatabaseConfiguration;
 import 
org.apache.shardingsphere.infra.config.database.impl.DataSourceGeneratedDatabaseConfiguration;
 import 
org.apache.shardingsphere.infra.config.database.impl.DataSourceProvidedDatabaseConfiguration;
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
+import 
org.apache.shardingsphere.infra.config.props.temporary.TemporaryConfigurationProperties;
 import 
org.apache.shardingsphere.infra.config.props.temporary.TemporaryConfigurationPropertyKey;
 import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
 import 
org.apache.shardingsphere.infra.database.core.metadata.database.DialectDatabaseMetaData;
@@ -156,8 +157,7 @@ public final class MetaDataContextsFactory {
     private static MetaDataContexts createByRepository(final 
MetaDataPersistService persistService, final ContextManagerBuilderParameter 
param,
                                                        final 
ComputeNodeInstanceContext computeNodeInstanceContext, @SphereEx final 
Map<String, QualifiedDataSourceState> statusMap) {
         @SphereEx
-        boolean isInstanceConnectionEnabled = Boolean.parseBoolean(
-                
String.valueOf(param.getProps().getOrDefault(TemporaryConfigurationPropertyKey.INSTANCE_CONNECTION_ENABLED.getKey(),
 Boolean.FALSE.toString())));
+        boolean isInstanceConnectionEnabled = new 
TemporaryConfigurationProperties(persistService.getPropsService().load()).getValue(TemporaryConfigurationPropertyKey.INSTANCE_CONNECTION_ENABLED);
         @SphereEx(Type.MODIFY)
         Map<String, DatabaseConfiguration> effectiveDatabaseConfigs =
                 
createEffectiveDatabaseConfigurations(getDatabaseNames(persistService), 
param.getDatabaseConfigs(), persistService, isInstanceConnectionEnabled);

Reply via email to