{
if (trace) log.trace("Workspace node " + workspaceNode.getFqn() + " deleted; removing");
if (underlyingNode.getFqn().isRoot())
{
throw new CacheException("An illegal attempt to delete the root node!");
}
else
{
// mark it as invalid so any direct references are marked as such
underlyingNode.setValid(false, true);
// we need to update versions here, too
performVersionUpdate(underlyingNode, workspaceNode);
if (!useTombstones)
{
// don't retain the tombstone
NodeSPI parent = underlyingNode.getParentDirect();
if (parent == null)
{
throw new CacheException("Underlying node " + underlyingNode + " has no parent");
}
parent.removeChildDirect(underlyingNode.getFqn().getLastElement());
}
}