ensure insert order

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
tchovis
Posts: 12
Joined: Fri 03 Apr 2009 12:56

ensure insert order

Post by 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

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

Post by 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.

Post Reply