new DOMTransaction(this, domDb, Lock.READ_LOCK) { public Object start() throws ReadOnlyException { LOG.debug("Pages used: " + domDb.debugPages(doc)); return null;
if(xupdateConsistencyChecks) { new DOMTransaction(this, domDb, Lock.READ_LOCK) { public Object start() throws ReadOnlyException { LOG.debug("Pages used: " + domDb.debugPages(doc)); return null; } }.run();  NodeList nodes = doc.getChildNodes(); NodeImpl n; for (int i = 0; i < nodes.getLength(); i++) { n = (NodeImpl) nodes.item(i); Iterator iterator = getNodeIterator( new NodeProxy(doc, n.getGID(), n.getInternalAddress())); iterator.next(); checkTree(iterator, n);
	public void checkTree(final DocumentImpl doc) {		LOG.debug("Checking DOM tree for document " + doc.getFileName());		new DOMTransaction(this, domDb, Lock.READ_LOCK) {			public Object start() throws ReadOnlyException {				LOG.debug("Pages used: " + domDb.debugPages(doc));				return null;			}		}.run();				NodeList nodes = doc.getChildNodes();		NodeImpl n;		for (int i = 0; i < nodes.getLength(); i++) {		    n = (NodeImpl) nodes.item(i);		    Iterator iterator =		        getNodeIterator(		                new NodeProxy(doc, n.getGID(), n.getInternalAddress()));		    iterator.next();		    checkTree(iterator, n);		}		NodeRef ref = new NodeRef(doc.getDocId());		final IndexQuery idx = new IndexQuery(IndexQuery.TRUNC_RIGHT, ref);		new DOMTransaction(this, domDb) {			public Object start() {				try {					domDb.findKeys(idx);				} catch (BTreeException e) {		            LOG.warn("start() - " + "error while removing doc", e);				} catch (IOException e) {		            LOG.warn("start() - " + "error while removing doc", e);				}				return null;			}		}		.run();	}