Implementing transactions over multiple databases

前端 未结 4 636
余生分开走
余生分开走 2020-12-01 15:34

I am performing data changes on multiple databases, and I want to implement a transaction that will cover all of the changes.

This is what I currently have:

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-01 16:04

    As cletus said, you need some kind of two-phase commit. As the article states, this doesn't always work in practice. If you need a robust solution, you must find a way to serialize the transactions in such a way that you can do them one after the other and roll them back individually.

    Since this depends on the specific case on which you don't provide any details, I can't give you ideas how to attack this.

提交回复
热议问题