Can db saves be embedded in a transaction? - Revisited

How to handle database rollback when a second save fails in ChronoForms.

Overview

The issue occurs because CF does not have a built-in transaction rollback feature for database saves.
Use PHP code in the Fail event of the second database save action to manually manage rollback or error handling.

Answered
ChronoForms v6
Ni NickOg 18 Jan, 2020
I did ask this a while ago and didn't find an answer,

If I add a db save action - to a table -T1- and add a second save action to a different table - T2 - under success for T1 but that second save to T2 fails does the first save to T1 roll back? That is Is there a rollback action or do I have to handle such scenarios in php?

Can db saves be embedded in a transaction? - Revisited image 1

Nick
Gr GreyHead 18 Jan, 2020
Answer
Hi Nick,


There's no roll-back - PHP in the Fail event of the second action is probably the simplest method.

Bob
Ni NickOg 18 Jan, 2020
Thanks Bob. Understood

Nick
This topic is locked and no more replies can be posted.