beberlei/DoctrineExtensions — Issue #68: Paginate & result cache
Author: armetiz
Created: 2012-01-24 11:01:37+00:00
State: open

Hi there,
I'm using doctrine 2.0.8 & Doctrine Extension master version.

I'm encountering trouble with result cache & paginate extension.
Maybe I don't know how using properly the cache system.. So it's more a question about how I have to use it rather than bug issue.

I have a custom system that configuration a QueryBuilder object.
At the end of process, I get the Query from QueryBuilder and set the cache result on it. After that, I use Paginate.

It's working well with ArrayCache, and I get a problem with ApcCache. I havn't test the other cache : XcacheCache / MemcacheCache.

So,
when doing :

- QueryBuilder configuration
- Get Query from QueryBuilder
- Set cache result on query with useResultCache(true).
- Create paginate query with Paginate
- Get result from paginated query

The result is okay only the first time, when APC cache is empty. All other calls in same condition result in empty data.

I have try to do :
- QueryBuilder configuration
- Get Query from QueryBuilder
- Create paginate query with Paginate
- Set cache result on paginated query with useResultCache(true).
- Get result from paginated query

In this order, it's ok and I have no problem with the following calls.
So, it appear to be a good solution. What do you think about it ?

My question is,
Is it normal that the first order doesn't work properly ? If it's normal, maybe an Nota Bene in documentation should be a good thing, isn't it ?
Paginate do a SQL query even if the APC cache is enable, is there a way to use APC cache ? Because, merge a cached query & an un-cached query can be dangerous for data cohesion. I'm clear ?

Thanks for this great extension,

Thomas Tourlourat.