Reputation: 575
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
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