Problem with not null foreign key

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Max70
Posts: 2
Joined: Thu 19 Nov 2009 22:17

Problem with not null foreign key

Post by Max70 » Wed 25 Nov 2009 21:37

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

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 26 Nov 2009 12:51

Thank you for the inquiry.
We are investigating the situation, I will let you about the results.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 08 Dec 2009 10:16

We have changed the erroneous behaviour in the latest build. Give it a try.

Post Reply