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.
Taavi, this is true when you are lazy loading, but what if you are eagerly fetching the row? I can't get any work around for this. This is creating so many queries.
Taavi Kõosaar
May 4, 2012 at 4:16 PM
A temporary workaround for guys with legacy database issues and cant fix the schema always (im in the same pain). The Nullable Tuplizer approach works nicely, but needs some maintenance.
Use that approach instead of not-found="ignore". In my case i maintain a list of bad reference cases such as where in database row value can be 0 or-1 to indicate that there is no reference (i.e. supposed to be NULL value in row).
Sÿl
March 29, 2012 at 1:55 PM
Same here, just signed it to vote for this, issue. I'm using nhibernate 3.2 I'm mapping an odd db in which database is inconsistent. Would be great if it could fixed soon
When using the
not-found=ignore
attribute in aone-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.