AREFERENCE property stores the UUID of a referenceable node (one having typemix:referenceable). The referential integrity ofREFERENCE properties must be guaranteed.
In level 2 implementations, enforcement of referential integrity means that when a node isremoved, a check must be done to ensure that noREFERENCE properties in the workspace still refer to nodes in the subtree to be removed. This check is done when an attempt is made to persist the removal of a node (that is, either onsave, or, if the change was made within a transaction, oncommit; in any case, the check is not done immediately onremove). If any references to a node in the subtree to be removed exist, aReferentialIntegrityException is thrown.
An exception is made to the referential integrity rule when theREFERENCE property in question is part of the frozen state of a version stored in version storage. In that case the frozenREFERENCE property may hold the UUID of a node that is no longer in the workspace (see8.2.2.9Reference Properties within a Version).