Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.2.0-ALPHA2
-
Fix Version/s: 1.2.0-ALPHA3
-
Component/s: None
-
Labels:None
Description
We need better control for setting the hash/key for resultset cache entries. Then provide a way to clear these cache entries.
http://trac.doctrine-project.org/ticket/2042
$temp = Doctrine_Query::create()
->from('Profile p')
->where('p.id=?', $o)
->setHydrationMode(Doctrine::HYDRATE_ARRAY)
->useResultCache(true, 3600, 'product_cache') // custom tag
->execute();
$temp = Doctrine_Query::create()
->from('Model m')
->setHydrationMode(Doctrine::HYDRATE_ARRAY)
->useResultCache(true, 3600, 'product_cache') // custom tag
->execute();
$temp = Doctrine_Query::create()
->from('News n')
->setHydrationMode(Doctrine::HYDRATE_ARRAY)
->useResultCache(true, 3600, 'news_cache') // custom tag
->execute();
and now
$conn = Doctrine_Manager::getConnection('sqlite_cache_connection');
$cacheDriver = new Doctrine_Cache_Db(array('connection' => $conn,
'tableName' => 'cache'));
$cacheDriver->deleteByTag('product_cache');
Issue Links
- relates to
-
DDC-47
Improve query resultset cache control
-
Would an use case as followed be also considered?
$temp = Doctrine_Query::create()
->from('Model m')
->setHydrationMode(Doctrine::HYDRATE_ARRAY)
->useResultCache(true, 3600,array('product_cache', 'product_clean')) // custom array with tags
->execute();
So multiple tags could be used as "labels" for an cache instance?