Transaction over multiple CActiveRecord

Hey guys

I have a form with several models attached,

after submission i want to save the records,

but only if all records were inserted successfully.

$trans1 = $model1->dbConnection->beginTransaction();

$trans2 = $model2->dbConnection->beginTransaction();

doesent seem to work, i also tried if i can do this over

all model records:

$modelTrans = CActiveRecord::$db->beginTransaction();



this somehow also doesnt seem to work since the record is being

inserted even though i made a rolback.

Help is much appreciated.



I’m doing it this way:

	$transaction = Yii::app()->db->beginTransaction();









	catch (Exception $e)



		Yii::app()->user->setFlash('error', "{$e->getMessage()}");



Seems to work fine.

i really don’t know what i am doing wrong here,

to test the rollback i added the following:

$transaction = Yii::app()->db->beginTransaction();



but the record is still entered in the database :(

i dont know what i am doing wrong, i set autocommit

to false in the config file (main.php)

I figured it out, my database is in MyISAM which has no transaction

support, sorry for the inconvenience.

Somehow Yii doesnt throw an error or a warning so i didn’t notice.