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

Query cache key can be incorrectly generated


    • Type: Bug
    • Status: Open
    • Priority: 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 (https://gist.github.com/944524). More appropriate place to fix it would be Doctrine_Query_Abstract::calculateQueryCacheHash().


        grass Pablo Grass added a comment -
        grass Pablo Grass added a comment - Could this be a duplicate of http://www.doctrine-project.org/jira/browse/DC-389 ? Are you querying a model with a *-to-many relation and applying a limit? See also http://www.doctrine-project.org/documentation/manual/1_2/en/dql-doctrine-query-language:limit-and-offset-clauses:the-limit-subquery-algorithm


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


            • Created: