use: Node.getReferences() to find are properties that refer to this file. regards, toby
On 7/3/08, Nick Stuart <[EMAIL PROTECTED]> wrote: > I dont know if this is really an issue or not, but reading the API and the > current behavior I think something is mixed. > > Fairly simple use case. I have a nt:linkedFile somewhere, and I try to > delete the original file (or nt:folder containing the file) and i get > a ReferentialIntegrityException. Looking at the JCR API ofr Item.remove() it > says it will only through this exception if I have READONLY access to the > item AND the item is outside the subtree. In my case the Item is outside the > subtree, but I believe I have read/write access to the linked item. > > Is there a 'good' way to accomplish what I want? I'm thinking I have to loop > through all the sub nt:folders and files and get their REFERENCE properties > and remove those. Kind of a pain, but not horrible. Is there a way to do > this automatically? > > The full exception I am getting is this: > > Caused by: javax.jcr.ReferentialIntegrityException: > 05ad7f33-336a-40b0-bc19-8ded288c89b6: the node cannot be removed because it > is still being referenced. > at > > org.apache.jackrabbit.core.state.SharedItemStateManager.checkReferentialIntegrity(SharedItemStateManager.java:1431) > at > > org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:565) > at > > org.apache.jackrabbit.core.state.SharedItemStateManager.beginUpdate(SharedItemStateManager.java:852) > at > > org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:882) > at > > org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:334) > at > > org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:337) > at > > org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:310) > at > > org.apache.jackrabbit.core.state.SessionItemStateManager.update(SessionItemStateManager.java:313) > at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1102) > at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:839) > > Thanks for the help and any extra info! > > > -Nick >
