seanyinx commented on a change in pull request #117: SCB-224 support retry 
sub-transaction
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/117#discussion_r163726832
 
 

 ##########
 File path: 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/CompensationMessageHandler.java
 ##########
 @@ -18,19 +18,26 @@
 package org.apache.servicecomb.saga.omega.transaction;
 
 import org.apache.servicecomb.saga.omega.context.CompensationContext;
+import org.apache.servicecomb.saga.omega.context.OmegaContext;
 
 public class CompensationMessageHandler implements MessageHandler {
   private final MessageSender sender;
+  private final OmegaContext omegaContext;
   private final CompensationContext context;
 
-  public CompensationMessageHandler(MessageSender sender, CompensationContext 
context) {
+  public CompensationMessageHandler(MessageSender sender, OmegaContext 
omegaContext, CompensationContext context) {
     this.sender = sender;
     this.context = context;
+    this.omegaContext = omegaContext;
   }
 
   @Override
-  public void onReceive(String globalTxId, String localTxId, String 
parentTxId, String compensationMethod, Object... payloads) {
+  public void onReceive(String globalTxId, String localTxId, String parentTxId,
+      String compensationMethod, Object... payloads) {
+    String oldLocalTxId = omegaContext.localTxId();
+    omegaContext.setLocalTxId(parentTxId);
 
 Review comment:
   why pushing and pop localTxId?

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