$dependency=new CDbCacheDependency('SELECT MAX(user_end_date) FROM tbl_user');
$data=User::model()->cache(1000,$dependency)->findAll($criteria);
$DP = new CActiveDataProvider('User', array('data'=>$data,'pagination'=>false));
echo $DP->totalItemCount; //gives for example 5 and this is not expected value
echo count($DP->getData());// and this one is correct and gives for example 1
if($DP->totalItemCount<5){
...
this code is not executed due to wrong value...
...
}
Is this some how connected with the cache? What could be wrong?