Doctrine 1
  1. Doctrine 1
  2. DC-963

Doctrine cache - Salt dissociation

    Details

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

      Description

      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");

        Activity

        Hide
        Thomas Tourlourat - Armetiz added a comment -

        to complete this bug, I think it's also a problem on DC 2..

        Show
        Thomas Tourlourat - Armetiz added a comment - to complete this bug, I think it's also a problem on DC 2..
        Hide
        Jaik Dean added a comment -

        There is already an (undocumented?) option "prefix" that allows this.

        $cacheDriver = new Doctrine_Cache_Apc(array('prefix' => 'MY UNIQUE SALT'));

        Show
        Jaik Dean added a comment - There is already an (undocumented?) option "prefix" that allows this. $cacheDriver = new Doctrine_Cache_Apc(array('prefix' => 'MY UNIQUE SALT'));

          People

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

            Dates

            • Created:
              Updated: