Incomplete
Details
Details
Assignee
Unassigned
UnassignedReporter
Xianfeng Lu
Xianfeng LuComponents
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created October 27, 2005 at 2:39 PM
Updated April 19, 2008 at 4:01 PM
Resolved November 13, 2006 at 5:02 AM
In a bi-directional parent-children relationship, if I call session.Find() to outer join fetch like this
IList lst = session.Find("from Parent p left outer join fetch p.Children");
I saw a SELECT...FROM Parent LEFT OUTER JOIN Children to fetch both parent object and child objects, but after it there is a SELECT...FROM Parent WHERE... to get children's parent from database. The second SQL is really not necessary since the parent has been in memory after the 1st SQL.
I don't know if the 2nd level cache can avoid the 2nd SELECT hitting database any way.