ensure insert order

ensure insert order

Postby tchovis » Wed 10 Feb 2010 20:35

i wish i could be able to ensure insert order os entities linke
when i do this

university.curses.InsertOnSubmit(curseA);
university.curses.InsertOnSubmit(curseB);
university.curses.InsertOnSubmit(curseC);
university.curses.InsertOnSubmit(curseD);

Db.SubmitChanges();

that the insert comands will be generated for curse A them B them C them D
tchovis
 
Posts: 12
Joined: Fri 03 Apr 2009 12:56

Postby AndreyR » Thu 11 Feb 2010 13:13

In most cases this order will be kept while submitting the changes.
But in some cases (for example, if there are some associations) it may be changed by LINQ to SQL engine.
So, the only way to guarantee the order preservation is to call SubmitChanges explicitly after every InsertOnSubmit.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to dotConnect for Oracle