Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Blocker Blocker
    • Resolution: Unresolved
    • Affects Version/s: 1.2.2
    • Fix Version/s: None
    • Component/s: Record
    • Labels:
      None

      Description

      Doctrine result cache isn't working properly.

      Here a simple example, when I'm calling query->execute (); parentProgram is related to a video.
      Into the Doctrine_Query_Abstract.php file

      line 1014 : I have just add some code to output data.
      [code]
      if ($cached === false)

      { // cache miss $stmt = $this->_execute($params); $this->_hydrator->setQueryComponents($this->_queryComponents); $result = $this->_hydrator->hydrateResultSet($stmt, $this->_tableAliasMap); $oVideo = $result[0]; echo "not cached "; var_dump (count ($oVideo->parentProgram->getReferences ())); $cached = $this->getCachedForm($result); $cacheDriver->save($hash, $cached, $this->getResultCacheLifeSpan()); }

      else

      { $result = $this->_constructQueryFromCache($cached); $oVideo = $result[0]; echo "cached "; var_dump (count ($oVideo->parentProgram->getReferences ())); exit (0); }

      [/code]

      The output of a query execution (the first with an empty APC cache) with "useResultCache" is :

      • not cached int(1)
      • cached int(0)

      The problem is coming from the serialize php function that can't serialize protected properties..
      getReferences is a getter to a protected property.. So data result can't work properly.

      A solution could be use __sleep function, and a public property that contain all important protected data.

        Activity

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Thomas Tourlourat - Armetiz
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: