About multiple entities transaction

0
Hi, there. I am considering following case.   ・to change the entityA.   ・Then to change the entityB. But an exception occurs. In this case, I want to rollback the entityA and entityB after entityB's exception. Specific Example: the bank transfer Transfer money from the bank accountA to the bank accountB.   [1]Reduce the accountA balance.   [2]Increase the accountB balance. In this case, [1] and [2] want to be in the same transaction. but I don't know the way to be same transaction on Mendix. Is there smart way?
asked
1 answers
1

This is the default error handling mechanic in Mendix: if an exception occurs in a microflow, everything is rolled back (in your case both AccountA balance and AccountB balance), nothing is committed to the database.

You can test this by adding an action which always throws an error (e.g. CreateVariable action in your microflow, type Integer, value 1 : 0) and inspecting changes in your database.

answered