ef4 delete cascade with Oracle

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
skoub
Posts: 32
Joined: Fri 21 May 2010 15:47

ef4 delete cascade with Oracle

Post by skoub » Mon 19 Jul 2010 21:03

hi!

i have configured my edml to accept delete cascade on a one-to-many relation (in the model part and in the store part). The database schema doesnt have the delete cascade enabled.

When i try to delete the master record, i get an foreign key exception.

i thought that EF4 would do the logic to delete in cascade but it seems not. So how should i configure my delete cascade? Do i need to put it everywhere (database, model and store)?

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

Post by AndreyR » Wed 21 Jul 2010 11:37

You are right, OnDlete="Cascade" should be both in conceptual and store parts of model, and your database should contain this rule. Here is a link about this behaviour:
http://stackoverflow.com/questions/2468 ... d-entities

Post Reply