When you try to remove an entity with associations you can get an exception if the OnRemoveAction of an association forbids the removal of a associated entity. The current message of this exception is : "Referential integrity violation on attempt to remove 'MyClass', Key='MyClass, (8968)'." Would it be possible to show in the message the entity and the associations preventing the removal? For instance, "Referential integrity violation (...) MyClass.Items has OnOwnerRemove = OnRemoveAction.Deny and contains MyItem, Key='MyItem, 1234' |
Issue 832 is created. Thanks! Not urgent but I'm having an hard time to find what is preventing the removal of one my entity types ;) Well, this doesn't mean we'll implement it ASAP, but it's scheduled for v4.4. Coming back to stress that it is a really important feature for us. We're struggling with objects that have a lot of relations. This feature would be a huge time saver. Olorin, just an idea: you could try catching ReferentialIntegrityException and get all the requested data from it. It has the following properties:
Done, exception message now contains all these properties. |