mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-3901: Eager Loading only returns first record in parent relationship #4773
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 (Sep 14, 2015).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user drewclauson:
When I set fetch="EAGER" on a OneToMany relationship, and run a findBy(array(), null, limit, offset) on the parent entity repository, the first query issued to SQL Server returns all the records of the parent entity, but the query for the child records only requests the child records of the first entity, instead of requesting all child records for all parent entities.
Consequently, Doctrine only returns the first parent entity and none of the rest in the collection.
Turning off eager loading changes it so it requests all the parent entities and then lazy loads the child records in one query per parent entity as expected.
@doctrinebot commented on GitHub (Sep 15, 2015):
Comment created by drewclauson:
Didn't intend to change status to Awaiting Feedback
@doctrinebot commented on GitHub (Sep 16, 2015):
Comment created by drewclauson:
After further research on my end, it looks like it's my dbal driver that's causing the issue as it's an unsupported sql server connector. I re-tested with MySQL as the db and it works fine. I don't see a way I can close this, so if anyone looks at this, please close it out.