zhfeng commented on issue #346: compensation method invoke before compensable 
method
URL: 
https://github.com/apache/servicecomb-pack/issues/346#issuecomment-446818758
 
 
   @stashslash @WillemJiang it looks like we need to indicate in the cancel 
method that the compensate is ongoing. Now I think it might throw the Exception 
which could cause the alpha server to re-invoke this compensate method later.
   
   ```
   void cancel(HotelBooking booking) throws Exception {
       Integer id = booking.getId();
       if (bookings.containsKey(id)) {
         bookings.get(id).cancel();
       } else {
         throw new Exception("can not cancel " + booking.getId());
       }
   }
   ```
   
   Also we could consider to add the status interface which reports to the 
alpha server.

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