DDC-47: Improve query resultset cache control #59

Closed
opened 2026-01-22 12:25:34 +01:00 by admin · 2 comments
Owner

Originally created by @beberlei on GitHub (Oct 14, 2009).

Jira issue originally created by user jwage:

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');
Originally created by @beberlei on GitHub (Oct 14, 2009). Jira issue originally created by user jwage: 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'); ```
admin closed this issue 2026-01-22 12:25:35 +01:00
Author
Owner

@beberlei commented on GitHub (Oct 15, 2009):

Comment created by 'romanb':

The problematic part here is that APC/memcache/xcache dont have any notion of tags or tagging cache entries. They provide simple a simple key/value store. So we need to work with that.

@beberlei commented on GitHub (Oct 15, 2009): Comment created by 'romanb': The problematic part here is that APC/memcache/xcache dont have any notion of tags or tagging cache entries. They provide simple a simple key/value store. So we need to work with that.
Author
Owner

@beberlei commented on GitHub (Oct 22, 2009):

Issue was closed with resolution "Fixed"

@beberlei commented on GitHub (Oct 22, 2009): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#59