I have verified this is a regression. It only occurs in #find operations, however; querying with the graph works perfectly fine as a workaround. I am not convinced the regression is actually related to the entity-graph changes Guillaume Smet. It seems to be related instead to a change in how associations are loaded via "subsequent select" (non-joined eager load). E.g., the test tries to load a Defect and its comments eagerly (via graph). Those comments specify that both the associated Defect and User ought to be eagerly loaded. The Defect is already loaded via the main #find; the User however needs to be loaded. In 5.3 and earlier the User load is triggered after the initial #find completes. In 5.4 it is triggered during the #find. It is a significant difference. In the finally block of #find the graphs are cleared from the LoadQueryInfluencers associated with the Session. So in 5.3 we have (roughly):
>> Session#find(Defect)
>> LoadQueryInfluencer#setGraph("defect.comments")
>> load Defect...
<< (finally) LoadQueryInfluencer#setGraph(null)
<< Session#find(Defect)
>> load User...
However, in 5.4 we have:
>> Session#find(Defect)
>> LoadQueryInfluencer#setGraph("defect.comments")
>> load Defect...
>> load User...
<< (finally) LoadQueryInfluencer#setGraph(null)
<< Session#find(Defect)
Any idea what changed in 5.4 that changed that behavior? |