Page 1 of 1

Problem with not null foreign key

Posted: Wed 25 Nov 2009 21:37
by Max70
Hi,
I have a table with a field foreign key in another table. This field could also be null. When I use this kind of object (with null foreign key field) LINQ to Oracle performs many useless query in order to retrieve the lookup record contents.

Ex.

In the table Products, the field ProductCategory is a foreign key in Categories table. In my Products table the ProductCategory field could also be null.

When I create object from Products table and I try to access to DCategories.Description the system queries for Categories even if the ProductCategory field is empty. It seems the system doesn't distinguish from null DCategories collection and not yet loaded DCategories collection. Every time I try to access to DCategories member (for the same object) the system perform a query for Categories.

dotConnect for Oracle 5.35.54

Posted: Thu 26 Nov 2009 12:51
by AndreyR
Thank you for the inquiry.
We are investigating the situation, I will let you about the results.

Posted: Tue 08 Dec 2009 10:16
by AndreyR
We have changed the erroneous behaviour in the latest build. Give it a try.