Rolling back on failure when using multiple databases using Ecto.Multi

Hello, I’m using Ecto for a project or mine and I’m running into issues with the rollback not working with a failed Ecto.Multi transaction that spans multiple databases. Is this not possible? Am I missing something?

Here’s a bit clearer example:
|>, fn _, _ -> ModuleA.does_some_data_transformation_in_a_transaction_on_repo1() end)
|>, fn _, _ -> ModuleB.does_some_data_transformation_in_a_transaction_on_repo2() end)
|>, fn _, _ -> ModuleC.does_some_data_transformation_in_a_transaction_on_repo3() end)
|> Repo3.transaction()

If the :db3 step fails the other two transactions aren’t rolled back. Is there a way to achieve this?

Ecto multi works by utilizing underlying database transaction mechanics, not by adding its own. Cross database transactions are not possible. You may want to check out something like which can implement a notion of rolling back that isn’t dependent on database level transactions.