CodeIgniter Forums
transactions using more than one model - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: transactions using more than one model (/showthread.php?tid=76757)



transactions using more than one model - joseCarlos - 06-16-2020

Hi again.
I would like to ask for some guidance in setting transactions across more than one model (table).
I have tried on a single model with no problem, but I fail to figure how to do multiple.
Should I just run all the queries I need from multiple tables on the same model?

As always thanks for the help and time.


RE: transactions using more than one model - never2ice - 08-13-2020

I have the same question.


RE: transactions using more than one model - InsiteFX - 08-14-2020

You can run as many queries as you want between the start/complete functions and they will all be committed or rolled back based on the success or failure of any given query.

So yes you can.