long id = node.getGID(); if (id < 0) { id = 1; return; } final long gid = id;
    public void storeNode(final Txn transaction, final StoredNode node, NodePath currentPath, boolean index) {        checkAvailableMemory();                final DocumentImpl doc = (DocumentImpl) node.getOwnerDocument();//        final boolean isTemp = TEMP_COLLECTION.equals(doc.getCollection().getName());        final IndexSpec idxSpec =             doc.getCollection().getIdxConf(this);//        final FulltextIndexSpec ftIdx = idxSpec != null ? idxSpec.getFulltextIndexSpec() : null;        long id = node.getGID();        if (id < 0) {            id = 1;            return;        }        final long gid = id;        final short nodeType = node.getNodeType();        final int depth = idxSpec == null ? defaultIndexDepth : idxSpec.getIndexDepth();        new DOMTransaction(this, domDb, Lock.WRITE_LOCK, doc) {            public Object start() throws ReadOnlyException {                long address = BFile.UNKNOWN_ADDRESS;                final byte data[] = node.serialize();                if (nodeType == Node.TEXT_NODE                    || nodeType == Node.ATTRIBUTE_NODE                    || doc.getTreeLevel(gid) > depth)                    address = domDb.add(transaction, data);                else {                    address = domDb.put(transaction, new NodeRef(doc.getDocId(), node.getNodeId()), data);                }                if (address == BFile.UNKNOWN_ADDRESS)                    LOG.warn("address is missing");                //TODO : how can we continue here ? -pb                node.setInternalAddress(address);                ByteArrayPool.releaseByteArray(data);                return null;            }        }        .run();        ++nodesCount;        nodeProcessor.reset(transaction, node, currentPath, index);        nodeProcessor.doIndex();    }