Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1216

A way to mark an entity to always use result cache. Like @UseResultCache class annotation.

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.x
    • Fix Version/s: 2.5
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      So that even associations, find(), findBy() etc will be affected. Very useful for entities that are being used on every request.

      Is that thinkable?

        Activity

        Show
        Fabio B. Silva added a comment - Fixed by : https://github.com/doctrine/doctrine2/commit/b081e5681d9dc75ea2ab4a609e1aff5f4b7f2b87
        Hide
        Menno Holtkamp added a comment -

        During development, I tried to have the out-of-the-box ORM layer handle as much of the queries as possible, essentially I used the Repository functions a lot:

        For example, having a specific Repository extend the Doctrine EntityRepository and do something like:

         
            public function findByName($name)
            {
                $criteria = array('_name' => $name);
                return parent::findBy($criteria);
            }
        

        Now all functionality is developed, I am optimizing performance and I find myself having to refer my Repository to my DAO layer which uses DQL, so I can enable the DQL Result Cache...

         
            public function findByName($name)
            {
               //Use the DAO so we can enable DQL ResultSet caching
                return $this->_getDao()->loadByName($name);
            }
        

        It would be nice to be able to configure 'DQL Result Cache = on' on Repository level as well...

        Show
        Menno Holtkamp added a comment - During development, I tried to have the out-of-the-box ORM layer handle as much of the queries as possible, essentially I used the Repository functions a lot: For example, having a specific Repository extend the Doctrine EntityRepository and do something like: public function findByName($name) { $criteria = array('_name' => $name); return parent::findBy($criteria); } Now all functionality is developed, I am optimizing performance and I find myself having to refer my Repository to my DAO layer which uses DQL, so I can enable the DQL Result Cache... public function findByName($name) { //Use the DAO so we can enable DQL ResultSet caching return $this->_getDao()->loadByName($name); } It would be nice to be able to configure 'DQL Result Cache = on' on Repository level as well...

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Reio Piller
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: