|
FWIW, the proposed change here really has nothing to do with whether the initial query dynamically fetched an association and cached it as part of the cached query results. It simply looks to leverage the second level entity cache for building the association.
-
If the associated entity is not cached, this change has no effect on the reported concern.
-
If the associated entity was not initially dynamically fetched by the query, this change still "loads" it. No real danger here, just not semantically the same as what the query asked for.
The prerequisite work needed to address this for real is being done under HHH-8272, specifically the addition of this notion of a LoadPlan. The idea being that the LoadPlan would in some form become part of the cached representation of the query results. We'd then know definitively which associations were fetched via the query.
|