Closed chrismayer closed 10 years ago
I don't have time right now to test this (and its effects) in our applications built atop SHOGun, but pointed @buehner towards this PR. Expect feedback here soon, @chrismayer.
Hi, i would not suggest to merge this commit as it seems to lead to heavy performance problems once you have a large number of associated entities (like a few hundred users in one group).
I tried one of our applications with the proposed EAGER config and it was not possible to use it anymore when groups are requested at some point.
Maybe you can try one of the following options:
Okay, sounds reasonable that performance will be a problem and in case of having a large number of entities. I will dig into that as soon I find a time slot.
I changed the title of this PR according to the new situation.
As discussed I provided another solution: Now the modules of the user object are fetched programatically within the same transaction while requesting the app-context, so the FetchType can remain LAZY within the model class. @buehner and @marcjansen would you please test again in your setup? TIA!
works for me, tested in big project setup. thanks for this, will merge
To prevent a LazyInitializationException when requesting the app-context with a logged in user the FetchMode of the Group-User- and the Group-Module-relationship is changed to EAGER.