generation order of reference properties not deterministic??

generation order of reference properties not deterministic??

Postby Holger_CP » Mon 13 Jul 2009 11:34

Hello,

We have detected a problem with the devart data provider.
We use dotconnect version 5.20.29.0 and oracle 10g.

Let's assume we have following tables:
    Table1: "User" with the colums: "ID" and "Name"
    Table2: "Family" with the columns: "ID", "Father", "Mother", "Son", "Daughter", which reference to the user table.

So far, so good. Now i can create the EDMX and display the family with following code:

Code: Select all
var result = from table in familyEntities.FAMILY
                  select table;
                        
            var firstFamily = result.FirstOrDefault();
            
            //load the user data
            firstFamily.USERReference.Load();
            firstFamily.USER1Reference.Load();
            firstFamily.USER2Reference.Load();
            firstFamily.USER3Reference.Load();


            //display the family
            label1.Text = string.Format("Father: {0}, Mother: {1}, Son: {2}, Daughter:{3}",
                                 firstFamily.USER1.NAME,      
                                 firstFamily.USER2.NAME,      
                                 firstFamily.USER.NAME,      
                                 firstFamily.USER3.NAME);




Now the Problem. I update the EDMX and include the following table:

    Table3: "Misc" with the columns: "ID", "User1" and "User2", which reference also to the user table.


Now it seems that the generation order of the (user) reference properties is not deterministic and the code above return wrong values
(e.g. firstFamily.USER1.NAME is not the father anymore, but the daughter etc.)


Till now everytime when we change and update the EDMX file we have to adjust our program code to avoid writing data into the wrong columns of the database. So, how can we handle this type of problem?


greetings, Holger

PS. We are not sure if this is a bug in the devart data provider, but we have tried to reproduce this with SQL Server and the Entity Framework and it works fine there.
Holger_CP
 
Posts: 3
Joined: Mon 13 Jul 2009 10:05

Postby AndreyR » Mon 13 Jul 2009 13:32

I have just tried the code you posted, using 5.20.33 version of dotConnect and failed to reproduce the problem.
Could you please try to update to the new version of dotConnects?
The new build will be available soon, I tried using it and also succeeded.
If the upgrade won't help, please send me (support * devart * com, subject "EF: Generation Order")
the generated models (before and after the update).
One more thing: please make sure that the underlying data layer was not changed.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to dotConnect for Oracle