SanityCheck.TRACE(node.gid + " not found.");
SanityCheck.TRACE("Node " + node.gid + " not found.");
    protected long findValue(Object lock, NodeProxy node) throws IOException,            BTreeException {        final DocumentImpl doc = (DocumentImpl) node.getDocument();        final NativeBroker.NodeRef nodeRef = new NativeBroker.NodeRef(doc                .getDocId(), node.getGID());        // first try to find the node in the index        final long p = findValue(nodeRef);        if (p == KEY_NOT_FOUND) {            // node not found in index: try to find the nearest available            // ancestor and traverse it            long id = node.getGID();            long parentPointer = -1;            do {                id = XMLUtil.getParentId(doc, id);                if (id < 1) {                    SanityCheck.TRACE(node.gid + " not found.");                    throw new BTreeException("node " + node.gid + " not found.");                }                NativeBroker.NodeRef parentRef = new NativeBroker.NodeRef(doc                        .getDocId(), id);                try {                    parentPointer = findValue(parentRef);                } catch (BTreeException bte) {                }            } while (parentPointer == KEY_NOT_FOUND);            	            final long firstChildId = XMLUtil.getFirstChildId(doc, id);            final Iterator iter = new NodeIterator(lock, this, node.getDocument(),                    parentPointer);            final NodeImpl n = (NodeImpl) iter.next();            n.setGID(id);            final long address = findNode(n, node.gid, iter);            if(address == 0) {//            	if(LOG.isDebugEnabled())//            		LOG.debug("Node data location not found for node " + node.gid);            	return KEY_NOT_FOUND;            } else            	return address;        } else            return p;    }