On Tue, Jul 21, 2009 at 8:42 PM, Khanapurkar, Mona
A.<[email protected]> wrote:
> Does Jackrabbit have an API to cleanup dangling references?
If you are talking about REFERENCE properties, it is impossible to
have dangling references right within the JCR API, because you cannot
remove a node that is still being pointed at. See the javadoc of the
Item.remove() method [1]:
A ReferentialIntegrityException will be thrown on save if this item or
an item in its subtree is currently the target of a REFERENCE property
located in this workspace but outside this item's subtree and the
current Session has read access to that REFERENCE property.
If you use STRING or PATH properties as ("weak") references, the best
way to check for them is by running an xpath search:
//*...@referenceprop='/dangling/path']
[1]
http://www.day.com/maven/jsr170/javadocs/jcr-1.0/javax/jcr/Item.html#remove()
Regards,
Alex
--
Alexander Klimetschek
[email protected]