|
From: NHibernate J. <mik...@us...> - 2007-06-13 22:22:48
|
[ http://jira.nhibernate.org/browse/NH-1001?page=comments#action_15662 ] Jesse commented on NH-1001: --------------------------- This issue also shows up in many-to-one assosciations that are eagerly fetched. So I assume it shows up anywhere that you can specify not-found=ignore. So the mapping below should not product an additional query when no result is initially found. <many-to-one name="Stock" access="nosetter.camelcase-underscore" class="RentalStock" column="intProductId" lazy="false" fetch="join" not-found="ignore" /> If the association is not found on the initial query, an additional query will be issued to the database to try and retrieve the association again. There is no need for any extra query since this should be determined by the first query. Or is there some reason that a second query needs to be issued? There is no second query when the association is found on the first query. This problem magnifies itself if batching is enabled. It will issue a batch query multiple times for the number of proxies in the session to find out if the entity exists. > Select statement issued for each not-found=ignore > ------------------------------------------------- > > Key: NH-1001 > URL: http://jira.nhibernate.org/browse/NH-1001 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.2.0.GA > Reporter: Tomer Avissar > Priority: Minor > Attachments: HRNHibernateTest.zip > > When using the not-found=ignore attribute in a one-to-many/many-to-many, NHibernate is issuing a query for every element not found in the collection, even when using an outer join. > In some cases this causes a significant performance overhead. -- 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 |