seanyinx commented on a change in pull request #114: SCB-227 stop sub tx from 
running when global tx failed
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/114#discussion_r161417086
 
 

 ##########
 File path: 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/TransactionAspect.java
 ##########
 @@ -57,7 +57,12 @@ Object advise(ProceedingJoinPoint joinPoint, Compensable 
compensable) throws Thr
     context.newLocalTxId();
 
     TimeAwareInterceptor interceptor = new 
TimeAwareInterceptor(this.interceptor);
-    interceptor.preIntercept(localTxId, signature, joinPoint.getArgs());
+    boolean ok = interceptor.preIntercept(localTxId, signature, 
joinPoint.getArgs());
+    if (!ok) {
+      LOG.info("Skipped transaction {} due to abort.", context.globalTxId());
+      context.setLocalTxId(localTxId);
+      return null;
 
 Review comment:
   not a good idea to return null, since user doesn't expect it

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to