Uploaded image for project: 'Doctrine 1'
  1. Doctrine 1
  2. DC-963

Doctrine cache - Salt dissociation


    • Type: Improvement
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Caching
    • Labels:


      Doctrine Cache store data into a persistence storage.

      Regarding APC, Doctrine use a share storage.
      Doctrine is able to cache SQL from DQL, and DOM from SQL.
      To do this, Doctrine create a DQL hash, and store the SQL result refer to the hash.

      I'm using a server to host two Doctrine project, a preproduction & production Website. In some case, DQL is the same on both project, but the data model definition isn't.

      Preproduction convert DQL to SQL using data model definition, and store the SQL result into APC cache refer to the DQL hash.
      Production create a DQL hash, this is the same hash as preproduction.. So production instance use the SQL refer to the preproduction..

      I'm not sure about the quality of this explanation... But I can add some information is needed.

      The solution of this problem is easy. Just add a SALT to any cache id's. It's a Doctrine_Cache problem, not only a Doctrine_Cache_APC problem..
      For Query cache it's not really important because this cache is optional, but for result cache.. It's more critical.
      The SALT can be define when instantiate the Doctrine_Cache object, it's just an option..

      $cacheDriver = new doctrine_Cache_Apc ();
      $cacheDriver->setOption ("salt", "domain.tld");


        armetiz Thomas Tourlourat - Armetiz created issue -


          • Assignee:
            romanb Roman S. Borschel
            armetiz Thomas Tourlourat - Armetiz
          • Votes:
            1 Vote for this issue
            1 Start watching this issue


            • Created: