// need to make a note of ALL nodes created here!!
List<NodeSPI> createdNodes = new LinkedList<NodeSPI>();
// we need to mark new nodes created as deleted since they are only created to form a path to the node being removed, to
// create a lock.
boolean created = lockManager.lockPessimistically(ctx, command.getFqn(), WRITE, true, false, true, true, createdNodes, true);
TransactionContext transactionContext = null;
if (ctx.getGlobalTransaction() != null)
{
transactionContext = ctx.getTransactionContext();
transactionContext.addRemovedNode(command.getFqn());
for (NodeSPI nodeSPI : createdNodes)
{
transactionContext.addRemovedNode(nodeSPI.getFqn());
nodeSPI.markAsDeleted(true);
}
}
lockAllForRemoval(dataContainer.peek(command.getFqn(), false, false), ctx, transactionContext);