private void validateSessionLiveWithoutPendingChanges() throws RepositoryException { session.checkLive(); if (session.hasPendingChanges()) { throw new InvalidItemStateException(JcrI18n.noPendingChangesAllowed.text()); } }
private void validateSessionLiveWithoutPendingChanges() throws RepositoryException { session.checkLive(); if (session.hasPendingChanges()) { throw new InvalidItemStateException(JcrI18n.noPendingChangesAllowed.text()); } }
@Test public void shouldNotHavePendingChanges() throws Exception { assertThat(session.hasPendingChanges(), is(false)); }
NodeIterator merge( AbstractJcrNode targetNode, String srcWorkspace, boolean bestEffort, boolean isShallow ) throws RepositoryException { targetNode.session().checkLive(); if (session().hasPendingChanges()) { throw new InvalidItemStateException(JcrI18n.noPendingChangesAllowed.text()); } try { targetNode.correspondingNodePath(srcWorkspace); } catch (ItemNotFoundException infe) { // return immediately if no corresponding node exists in that workspace return JcrEmptyNodeIterator.INSTANCE; } JcrSession sourceSession = targetNode.session().spawnSession(srcWorkspace, true); MergeCommand op = new MergeCommand(targetNode, sourceSession, bestEffort, isShallow); op.execute(); targetNode.session().save(); return op.getFailures(); }
NodeIterator merge( AbstractJcrNode targetNode, String srcWorkspace, boolean bestEffort, boolean isShallow ) throws RepositoryException { targetNode.session().checkLive(); if (session().hasPendingChanges()) { throw new InvalidItemStateException(JcrI18n.noPendingChangesAllowed.text()); } try { targetNode.correspondingNodePath(srcWorkspace); } catch (ItemNotFoundException infe) { // return immediately if no corresponding node exists in that workspace return JcrEmptyNodeIterator.INSTANCE; } JcrSession sourceSession = targetNode.session().spawnSession(srcWorkspace, true); MergeCommand op = new MergeCommand(targetNode, sourceSession, bestEffort, isShallow); op.execute(); targetNode.session().save(); return op.getFailures(); }
if (session().hasPendingChanges()) { throw new InvalidItemStateException(JcrI18n.noPendingChangesAllowed.text());
if (session().hasPendingChanges()) { throw new InvalidItemStateException(JcrI18n.noPendingChangesAllowed.text());