I am using the app db connection to run a stored procedure against MySQL5.5:
$cmd=yii::app()->db->createCommand('call JournalEntry(:_src_id, :_src_type,:_dst_id,:_dst_type,
:_src_amount, :_src_currency, :_dst_amount, :_dst_currency, :_description, :_category_id)');
$cmd->bindParam(':_src_id',$model->src_account,PDO::PARAM_INT);
$cmd->bindParam(':_src_type',$model->src_type,PDO::PARAM_INT);
$cmd->bindParam(':_dst_id',$model->dst_account,PDO::PARAM_INT);
$cmd->bindParam(':_dst_type',$model->dst_type,PDO::PARAM_INT);
$cmd->bindParam(':_src_amount',$model->src_amount,PDO::PARAM_STR);
$cmd->bindParam(':_src_currency',$model->src_currency,PDO::PARAM_INT);
$cmd->bindParam(':_dst_amount',$model->dst_amount,PDO::PARAM_STR);
$cmd->bindParam(':_dst_currency',$model->dst_currency,PDO::PARAM_INT);
$cmd->bindParam(':_description',$model->jnl_description,PDO::PARAM_STR);
$cmd->bindParam(':_category_id',$model->jnl_category,PDO::PARAM_STR);
$result=$cmd->queryAll();
The app error reported is a missing table but what seems to be happening is that it queries the catalog after the procedure has run and that fails - I see the following in the log (attached to the catalog query):
General error: 2014 Cannot execute queries while other unbuffered queries are active.
My procedure call is failing but is closing off any transactions. I have tried various tricks to close the connnection and also tried
Yii::app()->db->pdoInstance->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);
but that doesnt seem to work. Any help would be appreciated!