Hi,
I'm having an issue when saving an entity graph. There are two sub-entities in this graph, that have a foreign key relation to each other. When two such entities are added, the save operation inserts them in the wrong order, resulting in a foreign key violation.
There are three Tables:
- TRoot
- TSqlServer
- TApplication; has a foreign key to TSqlServer
The operation consists of fetching the root entity, manipulating it on a form and then saving it again. The root entity is fetched with the following prefetch:
path = new PrefetchPath2(RootEntity.EntityType)
path.Add(RootEntity.PrefetchPathTSqlServer_TRoot_Id_EntityCollection)
path.Add(RootEntity.PrefetchPathTApplication_TRoot_Id_EntityCollection)
The user then adds a TSqlServer Entity as well as a TApplication Entity referencing the new TSqlServer Entity.
All Primary Keys involved are GUIDs that are generated upon INSERT by SQL Server.
When saving the entity (with recursive=true), I get an Exception "The INSERT statement conflicted with the FOREIGN KEY constraint FK_TApplication_TSqlServer...
I'm using SD.LLBLGen.Pro Runtime Framework with version 5.0.6.
I'm probably missing somthing.
Thanks!