title: ending transaction with Yii::app()->end
body: <p>yii 1</p>
  
  <p>Will Mysql Innodb transaction also end after Yii::app()->end() ? 
  Here based on model validation an error is being returned to javascript :</p>
  
  <pre><code>    begin transaction
  
      if (!$model-&gt;save()) {
         echo CJSON::encode(array(
                                  "error"=&gt;true,
                                  "errorDetails" =&gt; $model-&gt;getErrors(),
                                  "code"=&gt;"500"
                      ));
         Yii::app()-&gt;end();
      }
  
     end transaction
  </code></pre>
  
  <p>Can we find active transactions for Yii::app() and end live transaction in above case since it will otherwise leave transaction open</p>
  
  <pre><code>Yii::app()-&gt;onEndRequest = function($event){
      //Find active transaction for current request and db and rollback 
  };
  </code></pre>