if (needToCopy) n.markForUpdate(dataContainer, writeSkewCheck);
}
else if (createIfAbsent) // else, do we need to create one?
{
parentFqn = fqn.getParent();
NodeSPI parent = wrapNodeForWriting(context, parentFqn, false, createIfAbsent, false, false, false);
// do we need to lock the parent to create children?
boolean parentLockNeeded = isParentLockNeeded(parent.getDelegationTarget());
// get a lock on the parent.
if (parentLockNeeded && acquireLock(context, parentFqn))
{
ReadCommittedNode parentRCN = (ReadCommittedNode) context.lookUpNode(parentFqn);
parentRCN.markForUpdate(dataContainer, writeSkewCheck);
}
// now to lock and create the node. Lock first to prevent concurrent creation!
acquireLock(context, fqn);
in = nodeFactory.createChildNode(fqn, null, context, false);
n = nodeFactory.createWrappedNode(in, parent.getDelegationTarget());
n.setCreated(true);
context.putLookedUpNode(fqn, n);
n.markForUpdate(dataContainer, writeSkewCheck);
}
}