jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Villegas <...@uniscope.jp>
Subject setProperty ItemNotFoundException
Date Wed, 22 Feb 2006 09:26:09 GMT
Hi,

I'm new to this list, and JIRA is very slow...

I having a trouble in which sometimes Node.setProperty throws an
ItemNotFoundException. It seems the node is corrupted, that property was
set previously and something went wrong. Now it throws ItemNotFound. I
try to trace the exception, and found that the id exists, so it seems
the property is defined somewhere but it gives the error when it tries
to retrieve the item state. So I tried to delete the node and recreate
it but it gives me the same error, I can't delete it.
Well, to make the deletion work, I did the following on
NodeImpl.onRemove()


        // remove properties
        // use temp set to avoid ConcurrentModificationException
        HashSet tmp = new HashSet(thisState.getPropertyNames());
        for (Iterator iter = tmp.iterator(); iter.hasNext();) {
            QName propName = (QName) iter.next();
            // remove the property entry
            thisState.removePropertyName(propName);
            // remove property
            PropertyId propId = new PropertyId(thisState.getNodeId(),
propName);
            try {
                itemMgr.getItem(propId).setRemoved();
            } catch (ItemNotFoundException ne) {
                // ignore it!!!!?????
            }
        }

Note the try/catch statement.
This works, I can now delete the node and recreate it. But I don't know
if this is correct or if it leaves garbage in the persistence storage.
Also I don't know how the node got to that state. But I need to do some
recovery.

Any thoughts?


Carlos

Mime
View raw message