0

In my new microservices arch we are planning to 2PC protocol to handle distributed TX mgmt as we are using Oracle shared DB. I am unable to find any right implementation over the web. Is there any link having proper implementation for the same?

A proper documentation on how to implement 2Pc protocol using java spring boot

7
  • You don't need 2-phase commit when you only have one database. Commented Aug 8, 2023 at 12:27
  • how can i handle distributed transactions ? if any of my microservice fails i need to roll back my other microservices DB commits as well. Commented Aug 8, 2023 at 12:46
  • Your system should not have that requirement. stackoverflow.com/questions/52031350/… Commented Aug 8, 2023 at 12:51
  • i may be missing something here to understand your answer. Let me elaborate my expectation. I have microservice1(m1) calls M2 for updating few records and M2 calls M3 to update/insert few records. If in case M3 failed to update then my system should roll back M2 and M1 DB transactions as well. I hope i am clear with my questions here. Commented Aug 8, 2023 at 13:03
  • Yes, I understand. You think you should be able to do whatever you want in a distributed architecture, and there should be a way to make it fine... but you can't and there isn't. After M1 and M2 do their updates, everything might die. The DB needs to be left in a consistent and valid state if that happens. Commented Aug 8, 2023 at 13:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.