Name mixinTypeName = nameFrom(mixinName);
// Change the mixin types property (atomically, even if some other operation snuck in and added the mixin) ...
SessionCache cache = sessionCache();
MutableCachedNode mutable = mutable();
mutable.addMixin(cache, mixinTypeName);
NodeTypes nodeTypes = session.nodeTypes();
JcrNodeType mixinType = nodeTypes.getNodeType(mixinTypeName);
if (!wasReferenceable && mixinType.isNodeType(JcrMixLexicon.REFERENCEABLE)) {
// Need to add the 'jcr:uuid' reference ...