2

If my code are like this

  • start transaction
  • first database update
  • first API call
  • second database update
  • second API call
  • third database update
  • third API call
  • end transaction

The rough idea is that all these operations must all success, otherwise this transaction need to be rolled back. What if everything is ok till the third API call. When the third API call failed (after some retries), we should rollback the transaction, but the first and second API call has already been called. What should I do in this case? What is the best architect for this scenario?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
manh.vu
  • 335
  • 1
  • 4
  • 14

0 Answers0