so I have:
$transaction = Yii::app()->db->beginTransaction();
try
{
Model::model()->updateCounters(blablabla);
Yii::app()->db->createCommand($sql)->execute();
}
catch(Exception $e)
{
return $transaction->rollback();
}
$transaction->commit();What I want to achieve here is to make sure that if one of the query fails to roll back the other as well. So either both or none! The above scheme does not work. I tested it by braking second query and I still end up with the first query executed successfully and the second failed.
Please point me to what I've gotten wrong or a better way of achieving this.
Cheers,
bettor

Help

















