Several Save Commands Without Transactions


I was reveiwing user module and in file /user/controllers/AdminController.php

I found Update action with code :

	public function actionUpdate()









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

				$old_password = User::model()->notsafe()->findByPk($model->id);

				if ($old_password->password!=$model->password) {







			} else $profile->validate();







That raise my doubts that 2 models user/profile saved one after other without any transaction opened.

Related tables are InnoDB and they support transactions. Is it a good practice, as user module is used by many people ?

its a mater of choice I personally like to do this stuff in a transaction, as you may have noticed author is validating the models before the stuff gets saved to the database basically if the data is invalid it wont save sort of like a transaction simulated in php