[eluser]mcnux[/eluser]
Could someone please advise me how I can create a transaction to span multiple updates on multiple models. Here's an example of what I'm trying to achieve:
Code:
$model1->trans_start();
$model1->save();
$model2->save();
die();
$model1->trans_complete();
In reality I would obviously handle failures from the saves but I was expecting the rollback to occur as the script dies before the transaction is committed. I can get this to work when auto_transaction is set to false but I would like to have this ability even with it on (or at least be able to turn off auto_transaction at runtime to enable me to perform the transaction).