jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Klimetschek" <aklim...@day.com>
Subject Re: Determine if Node has been deleted
Date Thu, 09 Oct 2008 15:17:44 GMT
If you use a REFERENCE property to reference your node, you won't be
able to delete the target node unless all references to it have been
resolved. This might be useful for certain applications, but for most
applications it might be better to use soft references (storing the
path and resolving the node in your application code). See rule #5
"References considered harmful" in David's model:


On Thu, Oct 9, 2008 at 4:34 PM, Micah Whitacre <mkwhitacre@gmail.com> wrote:
> What's the best way to determine if a node has been removed from the
> repository?  The use case I have is that I have a reference to a
> Node[1] object.  That node however could have been deleted by another
> user and therefore when I perform operations like hasNode(...) I get
> an exception.  Is there a proactively determine if that Node is still
> in the repository?  Or is the best way to determine this to not hold
> onto the Node but instead store off the path, and use the path to
> retrieve the Node each time using a PathNotFoundException?
> Thanks for your help,
> Micah
> [1] - http://day.com/maven/jsr170/javadocs/jcr-1.0/javax/jcr/Node.html

Alexander Klimetschek

View raw message