Inherited Entity with self-referencing ManyToMany: EXTRA_LAZY fetch mode not working #6083

Closed
opened 2026-01-22 15:26:31 +01:00 by admin · 2 comments
Owner

Originally created by @flaushi on GitHub (Oct 10, 2018).

I have one parent entity with several derived ones.
The derived ones hold references to the parent, with fetch="EXTRA_LAZY".
Still, when find'ing a derived one from the database, the references are fully fetched as well.
In case of a ManyToMany with 5000 references, this becomes costly.

I have illustrated my problem in detail on SO, https://stackoverflow.com/questions/52686088/inherited-entity-with-self-referencing-manytomany-extra-lazy-fetch-mode-not-wor (with bounty ;-))

Thank you for your help in advance!

Originally created by @flaushi on GitHub (Oct 10, 2018). I have one parent entity with several derived ones. The derived ones hold references to the parent, with fetch="EXTRA_LAZY". Still, when find'ing a derived one from the database, the references are fully fetched as well. In case of a ManyToMany with 5000 references, this becomes costly. I have illustrated my problem in detail on SO, https://stackoverflow.com/questions/52686088/inherited-entity-with-self-referencing-manytomany-extra-lazy-fetch-mode-not-wor (with bounty ;-)) Thank you for your help in advance!
admin closed this issue 2026-01-22 15:26:31 +01:00
Author
Owner

@Ocramius commented on GitHub (Oct 12, 2018):

Was this supposed to be closed?

@Ocramius commented on GitHub (Oct 12, 2018): Was this supposed to be closed?
Author
Owner

@flaushi commented on GitHub (Oct 15, 2018):

Well, I found some workaround but still think it is more a hack than a solution to my problem.

It seems there a not too many doctrine pros at SO, maybe their density is higher here ;-)

@flaushi commented on GitHub (Oct 15, 2018): Well, I found some workaround but still think it is more a hack than a solution to my problem. It seems there a not too many doctrine pros at SO, maybe their density is higher here ;-)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6083