protected WorkspaceNode lockAndCreateWorkspaceNode(NodeFactory nodeFactory, NodeSPI node, TransactionWorkspace workspace, GlobalTransaction gtx, long timeout)
{
boolean locked = lockManager.lock(node, READ, gtx, timeout);
if (!locked)
throw new TimeoutException("Unable to lock node " + node.getFqn() + " after timeout " + timeout + " for copying into workspace");
WorkspaceNode wn = nodeFactory.createWorkspaceNode(node, workspace);
lockManager.unlock(node, gtx);
return wn;