Doctrine 1
  1. Doctrine 1
  2. DC-999

Query cache key can be incorrectly generated


    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Caching, Query
    • Labels:


      1. We have two versions of the application on the same server.
      2. Second application has an updated database. New field is added to one of the models.
      3. When the second app is hit first, query is stored in APC.
      4. First app finds cached query and tries to call it. Exception is thrown as it doesn't know anything about the new field yet.

      Situation often happens on shared development machine when one developer adds a field but others don't have in their models yet. It also happens on staging server if it's shared with production.

      I suspect it only affects queries without explicitly listed fields.

      To quickly fix the issue in my symfony project I extended Doctrine_Cache_Apc to implement namespaces ( More appropriate place to fix it would be Doctrine_Query_Abstract::calculateQueryCacheHash().


        Pablo Grass added a comment -
        Pablo Grass added a comment - Could this be a duplicate of ? Are you querying a model with a *-to-many relation and applying a limit? See also


          • Assignee:
            Roman S. Borschel
            Jakub Zalas
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: