Skip to content

Commit dc0f4e0

Browse files
author
chengliefeng
committed
optimize: add tcc fence hook function (apache#6731)
1 parent 6d744ee commit dc0f4e0

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

spring/src/main/java/org/apache/seata/rm/fence/SpringFenceHandler.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -136,21 +136,6 @@ public Object prepareFence(String xid, Long branchId, String actionName, Callbac
136136
});
137137
}
138138

139-
/**
140-
* This method executes a Runnable with transaction context and logs any exceptions that occur without allowing them to propagate.
141-
* @param runnable the runnable
142-
* @param xid the global transaction id
143-
* @param branchId the branch transaction id
144-
* @param methodName the runnable name
145-
*/
146-
private void executeWithHandling(Runnable runnable, String xid, Long branchId, String methodName) {
147-
try {
148-
runnable.run();
149-
} catch (Exception e) {
150-
LOGGER.warn("Tcc fence Exception in {}, xid: {}, branchId: {}", methodName, xid, branchId, e);
151-
}
152-
}
153-
154139
/**
155140
* common commit method enhanced
156141
*
@@ -402,6 +387,21 @@ public void run() {
402387
}
403388
}
404389

390+
/**
391+
* This method executes a Runnable with transaction context and logs any exceptions that occur without allowing them to propagate.
392+
* @param runnable the runnable
393+
* @param xid the global transaction id
394+
* @param branchId the branch transaction id
395+
* @param methodName the runnable name
396+
*/
397+
private void executeWithHandling(Runnable runnable, String xid, Long branchId, String methodName) {
398+
try {
399+
runnable.run();
400+
} catch (Exception e) {
401+
LOGGER.warn("Tcc fence Exception in {}, xid: {}, branchId: {}", methodName, xid, branchId, e);
402+
}
403+
}
404+
405405
private static class FenceLogIdentity {
406406
/**
407407
* the global transaction id

0 commit comments

Comments
 (0)