[PR #5856] #5854 workaround to avoid populating Second Level Cache from DQL queries with multiple nested DQL aliases #9760

Closed
opened 2026-01-22 16:05:20 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/5856

State: closed
Merged: Yes


Provides workaround for #5854

Doesn't really fix the issue though.

The problem is following:

SELECT
    a, b, c
FROM
    A a
JOIN
    a.b b
JOIN
    b.c c

Caching a query like this one via SLC will have the DefaultQueryCache loop over associations of A, but using metadata of all DQL aliases/associations.

This workaround prevents that, but also disables caching of fetched c instances from this example.

Note: no tests provided, as existing tests already show the regression.

**Original Pull Request:** https://github.com/doctrine/orm/pull/5856 **State:** closed **Merged:** Yes --- Provides workaround for #5854 Doesn't really fix the issue though. The problem is following: ``` sql SELECT a, b, c FROM A a JOIN a.b b JOIN b.c c ``` Caching a query like this one via SLC will have the `DefaultQueryCache` loop over associations of `A`, but using metadata of all DQL aliases/associations. This workaround prevents that, but also disables caching of fetched `c` instances from this example. Note: no tests provided, as existing tests already show the regression.
admin added the pull-request label 2026-01-22 16:05:20 +01:00
admin closed this issue 2026-01-22 16:05:20 +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#9760