You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2019/07/22 02:12:23 UTC

[GitHub] [servicecomb-pack] coolbeevip commented on a change in pull request #506: SCB-1385 provide a common way to pass the GID and LID

coolbeevip commented on a change in pull request #506: SCB-1385 provide a common way to pass the GID and LID
URL: https://github.com/apache/servicecomb-pack/pull/506#discussion_r305652540
 
 

 ##########
 File path: omega/omega-transaction/src/main/java/org/apache/servicecomb/pack/omega/transaction/TransactionAspect.java
 ##########
 @@ -46,6 +48,20 @@ public TransactionAspect(SagaMessageSender sender, OmegaContext context) {
   @Around("execution(@org.apache.servicecomb.pack.omega.transaction.annotations.Compensable * *(..)) && @annotation(compensable)")
   Object advise(ProceedingJoinPoint joinPoint, Compensable compensable) throws Throwable {
     Method method = ((MethodSignature) joinPoint.getSignature()).getMethod();
+    // just check if we need to setup the transaction context information first
+    TransactionContext transactionContext = getTransactionContextFromArgs(joinPoint.getArgs());
+    if (transactionContext != null) {
+      if (context.globalTxId() != null) {
 
 Review comment:
   If you first determine if context.globalTxId() is not empty, is it better? 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services