From: NHibernate J. <mik...@us...> - 2006-11-13 18:04:10
|
[ http://jira.nhibernate.org/browse/NH-435?page=all ] Sergey Koshcheyev closed NH-435: -------------------------------- Resolution: Incomplete > Outer join fetch sends unnecessary SELECT to database to get parent > --------------------------------------------------------------------- > > Key: NH-435 > URL: http://jira.nhibernate.org/browse/NH-435 > Project: NHibernate > Type: Improvement > Components: Core > Versions: 1.0 > Reporter: Xianfeng Lu > Attachments: nh-435.rar > > 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. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |