iAmClever commented on code in PR #6766:
URL: https://github.com/apache/incubator-seata/pull/6766#discussion_r1732086248


##########
integration-tx-api/src/main/java/org/apache/seata/integration/tx/api/interceptor/ActionInterceptorHandler.java:
##########
@@ -119,6 +123,48 @@ public Object proceed(Method method, Object[] arguments, 
String xid, TwoPhaseBus
         }
     }
 
+    /**
+     * to do some business operations before tcc prepare
+     * @param xid          the xid
+     * @param branchId     the branchId
+     * @param actionName   the actionName
+     * @param context      the business action context
+     */
+    private void doBeforeTccPrepare(String xid, String branchId, String 
actionName, BusinessActionContext context) {
+        List<TccHook> hooks = TccHookManager.getHooks();
+        if (hooks.isEmpty()) {
+            return;
+        }
+        for (TccHook hook : hooks) {
+            try {
+                hook.beforeTccPrepare(xid, Long.valueOf(branchId), actionName, 
context);
+            } catch (Exception e) {
+                LOGGER.error("Failed execute beforeTccPrepare in hook {}", 
e.getMessage(), e);

Review Comment:
   > 我认为一阶段出现异常不应该catch,而是直接抛出异常提示用户,二阶段才需要考虑是否catch异常 I believe that 
exceptions occurring in the first phase should not be caught but rather thrown 
directly to alert the user. In the second phase, it is then appropriate to 
consider whether to catch exceptions.
   
   好,我修改下



-- 
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-unsubscr...@seata.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org
For additional commands, e-mail: notifications-h...@seata.apache.org

Reply via email to