eric-lee-ltk 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_r161452246
 
 

 ##########
 File path: 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/TransactionAspect.java
 ##########
 @@ -57,7 +57,13 @@ Object advise(ProceedingJoinPoint joinPoint, Compensable 
compensable) throws Thr
     context.newLocalTxId();
 
     TimeAwareInterceptor interceptor = new 
TimeAwareInterceptor(this.interceptor);
-    interceptor.preIntercept(localTxId, signature, joinPoint.getArgs());
+    AlphaResponse response = interceptor.preIntercept(localTxId, signature, 
joinPoint.getArgs());
+    if (response.aborted()) {
+      String abortedLocalTxId = context.localTxId();
+      context.setLocalTxId(localTxId);
+      throw new OmegaTxAbortedException("Abort local sub transaction " + 
abortedLocalTxId +
 
 Review comment:
   using the spring's TransactionException will introduce spring dependency in 
our omega transaction module, is it all right to do so?

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