UnitOfWork in combination with Cascade Deletes

Posts   
 
    
G.I.
User
Posts: 172
Joined: 09-Jun-2005
# Posted on: 03-Dec-2007 10:09:41   

Hi,

I have deliverables. Changes on these are stored in an audit table. It's possible to delete a deliverable from the database, which cascade deletes the audit info in that case ... this works fine.

However ... when I have a collection of deliverable entities on a grid and use the perform work event with unitofwork to pass deletes of the deliverables to the database ... I get an error that the deliverable can't be deleted because of that foreign key.

Doesn't cascade delete work together with a unitofwork?

Best regards,

  • G.I.

EDIT:

ok, it had to do with the auditor ... that tried to insert referenced data to the object just deleted. Fixed it by disabling editor in those occasions ...smile