tristaZero commented on a change in pull request #10351:
URL: https://github.com/apache/shardingsphere/pull/10351#discussion_r633218008



##########
File path: 
shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/driver/jdbc/JDBCExecutorCallback.java
##########
@@ -66,6 +66,9 @@
                 result.add(executeResult);
             }
         }
+        if (dataMap.containsKey(ExecuteProcessConstants.EXECUTE_ID.name())) {

Review comment:
       So we can not move these coding into `ExecuteProcessEngine` as 
`finish()` like other functions in this class?
   Plus, we have called `ExecuteProcessEngine.initialize` in all the places. I 
mean `JDBCExecutorCallback` is for  SQL process and report each child status, 
on the other hand, `DriverJDBCExecutor` is the main entrance for `initialize` 
and `finish`.

##########
File path: 
shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/process/ExecuteProcessEngine.java
##########
@@ -55,6 +55,13 @@ public static void initialize(final SQLStatementContext<?> 
context, final Execut
         }
     }
     
+    /**
+     * Clean up execution ID.
+     */
+    public static void cleanupExecutionID() {
+        
ExecutorDataMap.getValue().remove(ExecuteProcessConstants.EXECUTE_ID.name());

Review comment:
       Maybe `initialize()`, `finish()`  and `clean()` could form as,
   ```java
     try {
             ExecuteProcessEngine.initialize(sqlStatementContext, 
executionGroupContext);
             List<Integer> results = 
jdbcLockEngine.execute(executionGroupContext, sqlStatementContext, routeUnits, 
callback); // Child report
             ExecuteProcessEngine.finish(); // Final report
             return result;
           } catch (final Exception ex) {
               ExecuteProcessEngine.clean();
           }
   ```




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

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


Reply via email to