Class ForeignKeyViolationException
Thrown at commit when a transaction points a cascade foreign key ([Index(OnParentDelete = CascadeAction.Delete)]) at a parent that does not
exist, is destroyed, or is being destroyed by a committing transaction. The commit has made no change: its transaction is still open and may be rolled
back, or committed again once the reference is fixed.
public class ForeignKeyViolationException : TyphonException, ISerializable
- Inheritance
-
ForeignKeyViolationException
- Implements
- Inherited Members
Constructors
ForeignKeyViolationException(EntityId, EntityId, bool)
Creates the exception for child referencing parent.
public ForeignKeyViolationException(EntityId child, EntityId parent, bool parentDying)
Parameters
Properties
Child
The entity whose foreign key names Parent.
public EntityId Child { get; }
Property Value
IsTransient
True when the parent was only being destroyed: its destroy may abort.
public override bool IsTransient { get; }
Property Value
Parent
The parent the foreign key names.
public EntityId Parent { get; }
Property Value
ParentDying
The parent was being destroyed, not yet destroyed: that destroy may still abort, and a retry may then succeed.
public bool ParentDying { get; }