Hej, I have a class called Contract and each Contract can have 0 or 1 Transaction with it.
Unfortunately i have a legacy database, where the transctionId in Contract table can have value NULL, 0 or a real Id referencing transaction. I cannot change the database. So i tried using NotFound.Ignore() instead. (not-found="ignore") This works nicely when i get 1 contract and when there's transaction, also get that. However i also have a page which lists a bunch of contracts and even though in code i never specify for it to load the Transaction (not lazyly or eagerly), i can see from NHibernate Profiler that whereever the value is 0 it seems to make a lazy load try to find the transaction for contract. This causes a lot of queries against the database. When i turn off not-found="ignore" the lazy loading works nicely (no queries are generated to try to get a transaction with Id 0), however this is not suitable because it will throw an expcetion whenever i try to access transction and it is not found (its neither null or valid association id). Is this a known problem with not-found="ignore" ? Any workaround? Ideas? Thanks, -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
