Propagating Deletes
When you delete an object version or relationship, the repository engine can sometimes automatically delete other object versions and their attendant relationships. The automatic removal of an object version is called a propagated deletion. The process by which the repository engine first determines which propagated deletions are necessary and then performs those propagated deletions is called delete propagation.
Delete propagation is very useful for removing orphan objects that are no longer associated with other objects or collections in your information model. Delete propagation does not occur by default. The repository engine performs propagated deletions only when you remove a relationship whose corresponding origin collection type has the COLLECTION_PROPAGATEDELETE flag set. Such relationships are called delete-propagating relationships. This flag must be set in the information model on the collection.
A single delete propagation can result in the removal of many object versions. There are several reasons for this:
- A delete-propagating relationship can have a TargetVersions collection containing many items. As a result, deleting the relationship causes the deletion of all objects in the TargetVersions collection.
- An object version that you delete can have many delete-propagating origin relationships.
- An object version to be removed automatically (that is, by propagated deletion) can itself have delete-propagating origin relationships.
The following table provides specific topics for each of the actions that trigger delete propagation.
Topic | Description |
---|---|
Delete Propagation After Removing an Origin Relationship | Removing an origin relationship that has the COLLECTION_PROPAGATEDELETE set causes delete propagation. |
Delete Propagation After Removing a Destination Relationship | Removing a destination relationship that has the COLLECTION_PROPAGATEDELETE set causes delete propagation. |
Delete Propagation After Removing a Destination Target Version | Removing an item from the TargetVersions collection of an origin relationship that has the COLLECTION_PROPAGATEDELETE set causes delete propagation. |
Delete Propagation After Removing an Origin Target Version | Removing an item from the TargetVersions collection of a destination relationship that has the COLLECTION_PROPAGATEDELETE set causes delete propagation. |
Delete Propagation After Removing an Object Version | Removing an object version that has origin relationships that have the COLLECTION_PROPAGATEDELETE set causes delete propagation. |
See Also
CollectionDefFlags Enumeration