Deletes parent record before child

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
afva
Posts: 39
Joined: Thu 13 Aug 2009 21:22

Deletes parent record before child

Post by afva » Sat 10 Sep 2011 19:42

Hello,

I have 2 tables: a master (CT_ROLPATRONEN) and a detail (CT_ROLP_PROF).
After I delete the detail-record I delete the parent.
When I look in the changeset it looks o.k;

ChangeSetCount INS - UPD - DEL ================== > 0 - 0 - 2
Deletes: Comtare.InstellingenComtare.CT_ROLP_PROF
Deletes: Comtare.InstellingenComtare.CT_ROLPATRONEN

When I actually do the submitChanges() I get the OracleMessage ORA-2292: child-records found.
(I only have 1 detail record with this parent)
The generated statements are:
BEGIN DELETE FROM UPLUS.CT_ROLPATRONEN WHERE ID = :key1; DELETE FROM UPLUS.CT_ROLP_PROF WHERE ID = :key2; END;

So...He first deletes the parent instead of the child!!
Why is that? How can I change this?

BTW My bindings are:
C#:
ObservableCollection rolColl;
CollectionViewSource rolCVS;

rolCVS = TryFindResource("rolCVS") as CollectionViewSource;
_adapter.getAllRols(ref rolColl);
rolCVS.Source = rolColl;

XAML:



StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Tue 13 Sep 2011 15:29

Thank you for the report. We have reproduced this issue, we will inform you when it is fixed.

Post Reply