[PR #172] [MERGED] DDC-217 - Improve result cache support #7807

Closed
opened 2026-01-22 15:56:57 +01:00 by admin · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/172
Author: @beberlei
Created: 10/23/2011
Status: Merged
Merged: 10/27/2011
Merged by: @beberlei

Base: masterHead: DDC-217


📝 Commits (2)

  • adc4840 DDC-217 - Add support for QueryCacheProfiles and remove the old result caching code from ORM. Deprecate a bunch of methods in favor of using the AbstractQuery#getQueryCacheProfile method.
  • a8052de Added note about result cache changes

📊 Changes

12 files changed (+109 additions, -156 deletions)

View changed files

📝 UPGRADE_TO_2_2 (+14 -0)
📝 lib/Doctrine/ORM/AbstractQuery.php (+50 -95)
📝 lib/Doctrine/ORM/Configuration.php (+0 -21)
📝 lib/Doctrine/ORM/NativeQuery.php (+8 -8)
📝 lib/Doctrine/ORM/Query.php (+3 -0)
📝 lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php (+16 -3)
📝 lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php (+1 -8)
📝 lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php (+1 -5)
📝 lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php (+4 -4)
📝 lib/Doctrine/ORM/Query/Exec/SingleTableDeleteUpdateExecutor.php (+4 -4)
📝 lib/vendor/doctrine-dbal (+1 -1)
📝 tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php (+7 -7)

📄 Description

From the UPGRADE_TO_2_2 file:

ResultCache implementation rewritten

The result cache is completly rewritten and now works on the database result level, not inside the ORM AbstractQuery
anymore. This means that for result cached queries the hydration will now always be performed again, regardless of
the hydration mode. Affected areas are:

  1. Fixes the problem that entities coming from the result cache were not registered in the UnitOfWork
    leading to problems during EntityManager#flush. Calls to EntityManager#merge are not necessary anymore.
  2. Affects the array hydrator which now includes the overhead of hydration compared to caching the final result.

The API is backwards compatible however most of the getter methods on the AbstractQuery object are now
deprecated in favor of calling AbstractQuery#getQueryCacheProfile(). This method returns a Doctrine\DBAL\Cache\QueryCacheProfile
instance with access to result cache driver, lifetime and cache key.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/doctrine/orm/pull/172 **Author:** [@beberlei](https://github.com/beberlei) **Created:** 10/23/2011 **Status:** ✅ Merged **Merged:** 10/27/2011 **Merged by:** [@beberlei](https://github.com/beberlei) **Base:** `master` ← **Head:** `DDC-217` --- ### 📝 Commits (2) - [`adc4840`](https://github.com/doctrine/orm/commit/adc4840ccecad7e35f97e43c740dd30602ce2241) DDC-217 - Add support for QueryCacheProfiles and remove the old result caching code from ORM. Deprecate a bunch of methods in favor of using the AbstractQuery#getQueryCacheProfile method. - [`a8052de`](https://github.com/doctrine/orm/commit/a8052dec3775835852344951c4f5e9aa053b6004) Added note about result cache changes ### 📊 Changes **12 files changed** (+109 additions, -156 deletions) <details> <summary>View changed files</summary> 📝 `UPGRADE_TO_2_2` (+14 -0) 📝 `lib/Doctrine/ORM/AbstractQuery.php` (+50 -95) 📝 `lib/Doctrine/ORM/Configuration.php` (+0 -21) 📝 `lib/Doctrine/ORM/NativeQuery.php` (+8 -8) 📝 `lib/Doctrine/ORM/Query.php` (+3 -0) 📝 `lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php` (+16 -3) 📝 `lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php` (+1 -8) 📝 `lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php` (+1 -5) 📝 `lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php` (+4 -4) 📝 `lib/Doctrine/ORM/Query/Exec/SingleTableDeleteUpdateExecutor.php` (+4 -4) 📝 `lib/vendor/doctrine-dbal` (+1 -1) 📝 `tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php` (+7 -7) </details> ### 📄 Description From the UPGRADE_TO_2_2 file: # ResultCache implementation rewritten The result cache is completly rewritten and now works on the database result level, not inside the ORM AbstractQuery anymore. This means that for result cached queries the hydration will now always be performed again, regardless of the hydration mode. Affected areas are: 1. Fixes the problem that entities coming from the result cache were not registered in the UnitOfWork leading to problems during EntityManager#flush. Calls to EntityManager#merge are not necessary anymore. 2. Affects the array hydrator which now includes the overhead of hydration compared to caching the final result. The API is backwards compatible however most of the getter methods on the `AbstractQuery` object are now deprecated in favor of calling AbstractQuery#getQueryCacheProfile(). This method returns a `Doctrine\DBAL\Cache\QueryCacheProfile` instance with access to result cache driver, lifetime and cache key. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
admin added the pull-request label 2026-01-22 15:56:57 +01:00
admin closed this issue 2026-01-22 15:56:57 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7807