Cancel A Remaining Cache Query

Hello, Please see this code:


$dependecy = new CDbCacheDependency('SELECT MAX(update_time) FROM {{post}}')

CActiveDataProvider(Post::model()->cache($duration, $dependecy, 2), array (

    	'criteria' => array (

    	'condition' => 'status = 1',

            	'order' => 'DESC create_time',

    	)  	'pagination' => array (

    	'pageSize' => 20,   	

)  ));

cache query count is set 2. Issue is when database table is empty of records, second cache query save for next db query. I want both cache query complete in above code, even if table is empty.

Is there what solution?

How can i cancel a remaining cache query?

up . . .

Answer




Yii::app()->db->cache()->queryCount = 0;