RaigorJiang commented on code in PR #19834:
URL: https://github.com/apache/shardingsphere/pull/19834#discussion_r936624689


##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/ProxyBackendHandlerFactory.java:
##########
@@ -160,6 +159,16 @@ public static ProxyBackendHandler newInstance(final 
DatabaseType databaseType, f
         backendHandler = 
DatabaseAdminBackendHandlerFactory.newInstance(databaseType, 
sqlStatementContext, connectionSession);
         return backendHandler.orElseGet(() -> 
DatabaseBackendHandlerFactory.newInstance(logicSQL, connectionSession, 
preferPreparedStatement));
     }
+
+    private static void checkUnsupportedDistSQLStatementInTransaction(final 
SQLStatement sqlStatement, final ConnectionSession connectionSession) {
+        if (connectionSession.getTransactionStatus().isInTransaction() && 
!isSupportedDistSQLStatement(sqlStatement)) {
+            throw new UnsupportedOperationException("Non-query dist sql is not 
supported within a transaction");
+        }
+    }
+
+    private static boolean isSupportedDistSQLStatement(final SQLStatement 
sqlStatement) {

Review Comment:
   Could `isSupportedDistSQLStatementInTransaction` be better?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to