When I try to delete a record that has a referential contraint it produces an error which I would expect and does not delete the record, which is what I want it to do. The problem is that it still marks the record for deletion causing errors when I try and use that record. How can I clear that deletion flag so that the record is no longer marked?