@Test public void shouldAllowSessionToCreateAndAccessNewChildNodeOnExistingNodeBeforeSave() { check(cache).noNode("/childB/newChild"); print(false); MutableCachedNode nodeB = check(session1).mutableNode("/childB"); NodeKey newKey = session1.createNodeKeyWithIdentifier("newChild"); long nanos = System.nanoTime(); MutableCachedNode newChild = nodeB.createChild(session(), newKey, name("newChild"), property("p1a", 344), property("p2", false)); print("Time (createChild): " + millis(Math.abs(System.nanoTime() - nanos)) + " ms"); assertThat(newChild.getPath(session1), is(path("/childB/newChild"))); check(session1).children(nodeB, "childC", "childD", "newChild"); check(session1).property("/childB/newChild", property("p1a", 344)); check(session1).property("/childB/newChild", property("p2", false)); check(session2).children(nodeB.getKey(), "childC", "childD"); print(false); nanos = System.nanoTime(); session1.save(); print(false); print("Time (save): " + millis(Math.abs(System.nanoTime() - nanos)) + " ms"); check(session1).children(nodeB, "childC", "childD", "newChild"); check(session2).children(nodeB, "childC", "childD", "newChild"); check(session2).property("/childB/newChild", property("p1a", 344)); check(session2).property("/childB/newChild", property("p2", false)); }
@Override public void save() { save((PreSave)null); }
WritableSessionCache extends AbstractSessionCache { @Override public void save() { save((PreSave)null); } }
WritableSessionCache extends AbstractSessionCache { @Override public void save() { save((PreSave)null); } WritableSessionCache(ExecutionContext context,
                                WorkspaceCache workspaceCache,
                                TransactionalWorkspaceCaches txWorkspaceCaches,
                                RepositoryEnvironment repositoryEnvironment); }
WritableSessionCache extends AbstractSessionCache { @Override public void save() { save((PreSave)null); } WritableSessionCache(ExecutionContext context,
                                WorkspaceCache workspaceCache,
                                TransactionalWorkspaceCaches txWorkspaceCaches,
                                RepositoryEnvironment repositoryEnvironment); @Override CachedNode getNode( NodeKey key ); @Override SessionNode mutable( NodeKey key ); @Override boolean isReadOnly(); @Override Set<NodeKey> getChangedNodeKeys(); @Override Set<NodeKey> getChangedNodeKeysAtOrBelow( CachedNode srcNode ); @Override boolean hasChanges(); @Override void checkForTransaction(); @Override void save(); @Override void save( SessionCache other,
                      PreSave preSaveOperation ); @Override void save( Set<NodeKey> toBeSaved,
                      SessionCache other,
                      PreSave preSaveOperation ); @SuppressWarnings( "finally" ) @Override void destroy( NodeKey key ); @Override boolean isDestroyed( NodeKey key ); @Override String toString(); }
WritableSessionCache extends AbstractSessionCache { @Override public void save() { save((PreSave)null); } WritableSessionCache(ExecutionContext context,
                                WorkspaceCache workspaceCache,
                                TransactionalWorkspaceCaches txWorkspaceCaches,
                                RepositoryEnvironment repositoryEnvironment); @Override CachedNode getNode( NodeKey key ); @Override SessionNode mutable( NodeKey key ); @Override boolean isReadOnly(); @Override Set<NodeKey> getChangedNodeKeys(); @Override Set<NodeKey> getChangedNodeKeysAtOrBelow( CachedNode srcNode ); @Override boolean hasChanges(); @Override void checkForTransaction(); @Override void save(); @Override void save( SessionCache other,
                      PreSave preSaveOperation ); @Override void save( Set<NodeKey> toBeSaved,
                      SessionCache other,
                      PreSave preSaveOperation ); @SuppressWarnings( "finally" ) @Override void destroy( NodeKey key ); @Override boolean isDestroyed( NodeKey key ); @Override String toString();  }