How can we make sure that a transaction is commited to an external dababase?


Given the setup like the image in attach, can someone please explain me the expected behaviour? 


If the create in external table fails what is the outcome? Does it continue and does the Update_In_Internal_Table? Or breaks the cicle? Shoul i add another commit transaction action after the Create_In_External_Table? Or the existing one is sufficient to commit both?


Thanks in advance

Solution

Hi Nuno,

If the Create fails, then a Database Exception will be generated, so the cycle will break. If you catch the Database Exception with an Exception Handler, you can use the Abort Transaction property to control if a rollback occurs or not.

After a successful web request (i.e. one that doesn't end in an exception), the OutSystems platform will do a commit on the database, so normally you wouldn't have to use CommitTransaction in this case.

But if you do use CommitTransaction, then yes, one commit is enough to commit both.

Kind regards,

Wouter.




Solution

Thanks for the explanation Wouter Teensma.