public void save()

in src/main/java/org/apache/sling/jcr/base/internal/mount/ProxySession.java [387:414]


    public void save() throws AccessDeniedException, ItemExistsException, ReferentialIntegrityException, ConstraintViolationException, InvalidItemStateException, VersionException, LockException, NoSuchNodeTypeException, RepositoryException {
        if (sync != null) {
            for (String path : sync) {
                if (this.jcr.nodeExists(path)) {
                    Node jcrNode = jcr.getNode(path);
                    Node mountNode = mount.nodeExists(path) ?
                            mount.getNode(path) :
                            mount.getNode(PathUtils.getParentPath(path)).addNode(PathUtils.getName(path), jcrNode.getPrimaryNodeType().getName());
                    for (PropertyIterator iter = jcrNode.getProperties(); iter.hasNext(); ) {
                        Property property = iter.nextProperty();
                        try {
                            if (property.isMultiple()) {
                                mountNode.setProperty(property.getName(), property.getValues());
                            } else {
                                mountNode.setProperty(property.getName(), property.getValue());
                            }
                        } catch (ConstraintViolationException ex) {
                        }
                    }
                }
            }
            sync = null;
        }

        this.jcr.save();

        this.mount.save();
    }