code: private void saveUser(Session session, UserImpl user, boolean broadcast) throws Exception
     {
        Node userNode = getUserNode(session, user);
  
        if (broadcast)
        {
           preSave(user, false);
        }
  
        String oldName = userNode.getName();
        String newName = user.getUserName();
  
        if (!oldName.equals(newName))
        {
           String oldPath = userNode.getPath();
           String newPath = utils.getUserNodePath(newName);
  
           session.move(oldPath, newPath);
  
           removeFromCache(oldName);
           moveMembershipsInCache(oldName, newName);
        }
  
        writeUser(user, userNode);
        session.save();
  
        putInCache(user);
  
        if (broadcast)
        {
           postSave(user, false);
        }
     }
docs: Persists user.