Multiple Model Transaction

I have two model and wanna commit and roleback this. The db is oracle.

			if($model->validate() && $channels->validate()) {

			    /*declarate the transaction*/

			    $transaction = $model->dbConnection->beginTransaction();


			    try  {

				/*save the campaign model and commit it*/



				/*model pk save to channels fk*/

				$channels->CAMPAIGN_ID = $model->CAMPAIGN_ID;  //error why dont have the id

                                /*channels.campaign_id is a fk*/



				/*save the channels model and commit it*/


				/*if no error redirect to view*/


			    } catch (Exception $e) {


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




If i use the oracle sequence.nextval, return error: fk contrains.

Any idea?

just a quick question: where exactly is your


Ohh, thx. I forgot this method. :rolleyes: