You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "Pace2Car (via GitHub)" <gi...@apache.org> on 2023/05/18 02:43:25 UTC

[GitHub] [shardingsphere] Pace2Car commented on a diff in pull request #25743: Rebuild TransactionRuleConfiguration when set dist variable transaction_type

Pace2Car commented on code in PR #25743:
URL: https://github.com/apache/shardingsphere/pull/25743#discussion_r1197288190


##########
proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetDistVariableUpdater.java:
##########
@@ -122,12 +126,18 @@ private void syncSQLSimpleToLoggingRule(final TypedPropertyKey propertyKey, fina
     
     private void handleVariables(final ConnectionSession connectionSession, final SetDistVariableStatement sqlStatement) {
         VariableEnum variable = VariableEnum.getValueOf(sqlStatement.getName());
-        switch (variable) {
-            case TRANSACTION_TYPE:
-                connectionSession.getTransactionStatus().setTransactionType(getTransactionType(sqlStatement.getValue()));
-                break;
-            default:
-                throw new UnsupportedVariableException(sqlStatement.getName());
+        if (variable == VariableEnum.TRANSACTION_TYPE) {
+            ContextManager contextManager = ProxyContext.getInstance().getContextManager();
+            Collection<RuleConfiguration> ruleConfigurations = contextManager.getMetaDataContexts().getMetaData().getGlobalRuleMetaData().getConfigurations();

Review Comment:
   Changed, THX for point out



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org