FlyingZC commented on code in PR #22029:
URL: https://github.com/apache/shardingsphere/pull/22029#discussion_r1019774571


##########
proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/ProxySQLExecutor.java:
##########
@@ -143,16 +134,40 @@ private boolean isPostgreSQLOrOpenGaussStatement(final 
SQLStatement sqlStatement
      * @throws SQLException SQL exception
      */
     public List<ExecuteResult> execute(final ExecutionContext 
executionContext) throws SQLException {
+        return needAutoTransaction(executionContext) ? 
doExecuteWithinTransaction(executionContext) : doExecute(executionContext);
+    }
+    
+    private boolean needAutoTransaction(final ExecutionContext 
executionContext) {
+        TransactionStatus transactionStatus = 
backendConnection.getConnectionSession().getTransactionStatus();
+        SQLStatement sqlStatement = 
executionContext.getSqlStatementContext().getSqlStatement();
+        return TransactionType.XA == transactionStatus.getTransactionType() && 
!transactionStatus.isInTransaction() && sqlStatement instanceof DMLStatement

Review Comment:
   Yes, BASE transaction also supports this feature.



-- 
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