long logLsn)
throws DatabaseException {
boolean found = false;
boolean deleted = false;
Tree tree = db.getTree();
SearchResult result = new SearchResult();
try {
/* Search for the parent of this target node. */
result = db.getTree().getParentINForChildIN
(nodeId,
containsDuplicates,
false, // do not stop at dup tree root
mainKey,
dupKey,
false, // requireExactMatch
false, // updateGeneration
-1, // targetLevel
null, // trackingList
true); // doFetch
if (result.parent == null) {
/* It's null -- we actually deleted the root. */
tree.withRootLatched(new RootDeleter(tree));
DbTree dbTree = db.getDbEnvironment().getDbMapTree();
dbTree.modifyDbRoot(db);
traceRootDeletion(Level.FINE, db);
deleted = true;
} else if (result.exactParentFound) {