Ash FrameworkAF
Ash Framework5mo ago
19 replies
MortenLund

Resource actions - Transaction

Hi!

I am currently working on some :create actions where I have SQLite3 as the datalayer.

I have both before_action, manage_relatonship and after_action and I was expecting the whole create action to fail and the transaction to rollback if any of the changes failed. But this does not seem to be the case..?

I have tried to set transaction? true manually but it still creates the tables entries even if manage_relationship fails and/or if any of the after_action fails.

Looking at this chart: https://hexdocs.pm/ash/3.5.36/actions.html#complete-lifecycle-flow it seems that the transaction rollback only applies to the creation of the outer row, not related rows or after_action ?

Is this a job that is better handled by AshReactor or something similar?
Was this page helpful?