Random Transaction Error

Im starting the transaction like this

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

and doing many "$model->save" in actionCreate

and in the end if save/validate fails i rollback ,

But Sometimes usually the first time i run , i get error on transaction->commit :S

Error : CDbTransaction is inactive and cannot perform commit or roll back operations.

CANT FIND ANYTHING on this topic any pointers would be greatly helpfull .

ThankYou in Advance