DDC-1216: A way to mark an entity to always use result cache. Like @UseResultCache class annotation. #1528

Closed
opened 2026-01-22 13:17:04 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Jun 19, 2011).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user hypno:

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

Is that thinkable?

Originally created by @doctrinebot on GitHub (Jun 19, 2011). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user hypno: So that even associations, find(), findBy() etc will be affected. Very useful for entities that are being used on every request. Is that thinkable?
admin added the New Feature label 2026-01-22 13:17:04 +01:00
admin closed this issue 2026-01-22 13:17:04 +01:00
Author
Owner

@doctrinebot commented on GitHub (Apr 6, 2012):

Comment created by holtkamp:

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...

@doctrinebot commented on GitHub (Apr 6, 2012): Comment created by holtkamp: 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...
Author
Owner

@doctrinebot commented on GitHub (Dec 20, 2013):

Comment created by @FabioBatSilva:

Fixed by : b081e5681d

@doctrinebot commented on GitHub (Dec 20, 2013): Comment created by @FabioBatSilva: Fixed by : https://github.com/doctrine/doctrine2/commit/b081e5681d9dc75ea2ab4a609e1aff5f4b7f2b87
Author
Owner

@doctrinebot commented on GitHub (Dec 20, 2013):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Dec 20, 2013): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1528