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

 ##########
 File path: 
omega/omega-transaction/src/main/java/org/apache/servicecomb/pack/omega/transaction/TransactionAspect.java
 ##########
 @@ -46,6 +48,15 @@ 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) {
+      LOG.debug("Updated context {} for globalTxId:{} and localTxId:{}", 
context,
+          transactionContext.globalTxId(), transactionContext.localTxId());
+      context.setGlobalTxId(transactionContext.globalTxId());
+      context.setLocalTxId(transactionContext.localTxId());
+    }
 
 Review comment:
   As we just get the transactionContext from business object, we need to pass 
them into next invocation as the omega transport does. Any thought?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to