Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-47

Improve query resultset cache control

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-ALPHA3
    • Fix Version/s: 2.0-ALPHA3
    • Component/s: ORM
    • Security Level: All
    • 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

          Activity

          Hide
          Roman S. Borschel added a comment -

          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.

          Show
          Roman S. Borschel added a comment - 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.

            People

            • Assignee:
              Jonathan H. Wage
              Reporter:
              Jonathan H. Wage
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: