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



##########
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:
       Could not. Since `void finish(final String executionID)` may be not 
executed on exception, but `void cleanupExecutionID()` must be executed after 
`void initialize(context, executionGroupContext)`.

##########
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:
       Since
   
   - `finishReport(dataMap, executionUnit)` is in `JDBCExecutorCallback.java `, 
and it has `if 
(dataMap.containsKey(ExecuteProcessConstants.EXECUTE_ID.name()))`, make 
`finish` correspond to it
   - it has less places to add this piece of code if we add it in 
`JDBCExecutorCallback` and `RawSQLExecutorCallback` than in 
`DriverJDBCExecutor`, `ProxyJDBCExecutor`, `RawExecutor` and 
`CalciteRowExecutor`
   




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