mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1632: one-to-many associations with fetch mode eager using too many SQL queries #2050
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Feb 2, 2012).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user ausi:
I am loading a list of many entities.
These entities have a one-to-many association to other entities.
These other entities should be loaded in one single SQL query (instead of one query for every entity in the first list).
As discribed in the doctrine2 documentation: http://www.doctrine-project.org/docs/orm/2.1/en/reference/dql-doctrine-query-language.html#temporarily-change-fetch-mode-in-dql this should be possible with "EAGER" loading.
but it does not work as described.
my code:
The method UserRepository::findUsersWithAddresses() executes 11 SQL Queries instead of 2 SQL Queries.
I am using:
@doctrinebot commented on GitHub (Feb 6, 2012):
Comment created by @beberlei:
Increased priority
@doctrinebot commented on GitHub (Feb 9, 2012):
Comment created by ausi:
there is also a question on stackoverflow about this issue: [http://stackoverflow.com/questions/9020433/doctrine2-loads-one-to-many-associations-with-fetch-mode-eager-using-too-many-sq]
@doctrinebot commented on GitHub (Feb 9, 2012):
Comment created by @beberlei:
Its not a bug, its just a feature we haven't implemented yet.
There is a ticket for it
@doctrinebot commented on GitHub (Feb 9, 2012):
Issue was closed with resolution "Invalid"
@doctrinebot commented on GitHub (Feb 10, 2012):
Comment created by ausi:
Sorry, I didn't found the ticket before I reported this issue.
now i found it :) [http://www.doctrine-project.org/jira/browse/DDC-1149]
Would be very great to have this feature in a future version of doctrine.