Haseeb Mazhar Ranga
Haseeb Mazhar Ranga

Reputation: 575

does exposed support transaction across multiple databases

In some use-cases, I need to update data in two databases. Exposed provide transaction closure to query single database and if there is an exception, it will revert all the changes to the database which is linked to this transaction. But is there any way, I can create a global transaction that can revert all the changes to both databases if there is an exception?

Upvotes: 1

Views: 931

Answers (1)

Tapac
Tapac

Reputation: 2337

No, global or distributed transactions are not supported in Exposed. You can try to implement it by yourself but the main problem is that in simple implementation it's not possible to rollback the "inner" transaction when it was already commit and the "outer" throws the exception.

Upvotes: 1

Related Questions