/** * Forwards the method call to the underlying session. */ public boolean hasPendingChanges() throws RepositoryException { return session.hasPendingChanges(); }
private void ungetSession(Session session) { if (session != null) { try { if (session.hasPendingChanges()) { session.save(); } } catch (RepositoryException e) { log.error("Cannot save session", e); } } }
private void ungetSession(Session session) { if (session != null) { try { if (session.hasPendingChanges()) { session.save(); } } catch (RepositoryException e) { log.debug("Cannot save session", e); } } }
private long internalSave(boolean sessionSave) throws RepositoryException { if (autoSaveEnabled || (sessionSaveEnabled && sessionSave)) { long now = System.currentTimeMillis(); // Save the session if (this.session.hasPendingChanges()) { this.session.save(); } return System.currentTimeMillis() - now; } else { return -1L; } }
/** * Returns true if the session has pending (unsaved) changes. */ @Override public boolean hasPendingChanges() throws RepositoryException { return this.getJcrSession().hasPendingChanges(); }
public static void dumpChanges(Session session, PrintWriter out) throws RepositoryException { if (session.hasPendingChanges()) { dumpChanges(session.getRootNode(), out); } }
/** {@inheritDoc} */ public boolean hasPendingChanges() throws RepositoryException, RemoteException { try { return session.hasPendingChanges(); } catch (RepositoryException ex) { throw getRepositoryException(ex); } }
/** * Return true if it has pending changes. */ public boolean hasPendingChanges() throws RepositoryException { return getSession().hasPendingChanges(); }
/** * Return true if it has pending changes. */ public boolean hasPendingChanges() throws RepositoryException { return getSession().hasPendingChanges(); }
@Override default boolean hasPendingChanges() throws RepositoryException { return unwrapSession().hasPendingChanges(); }
@Override public boolean hasPendingChanges() throws RepositoryException { return getWrappedSession().hasPendingChanges(); }
/** * Operation is performed entirely within the persistent workspace, it does * not involve transient storage and therefore does not require a save */ public void testCopyNodes() throws RepositoryException { // copy referenceable node below non-referenceable node String dstAbsPath = node2.getPath() + "/" + node1.getName(); workspace.copy(node1.getPath(), dstAbsPath); // there should not be any pending changes after copy assertFalse(superuser.hasPendingChanges()); }
/** * Operation is performed entirely within the persistent workspace, it does * not involve transient storage and therefore does not require a save */ public void testMoveNodes() throws RepositoryException { String dstAbsPath = node2.getPath() + "/" + node1.getName(); workspace.move(node1.getPath(), dstAbsPath); // there should not be any pending changes after copy assertFalse(superuser.hasPendingChanges()); }
@Override public boolean hasChanges(final @Nonnull ResolveContext<JcrProviderState> ctx) { try { return ctx.getProviderState().getSession().hasPendingChanges(); } catch (final RepositoryException ignore) { logger.warn("Unable to check session for pending changes.", ignore); } return false; }
/** * If successful, the changes are persisted immediately, there is no need to * call save. */ public void testCloneNodes() throws RepositoryException { // clone referenceable node below non-referenceable node String dstAbsPath = node2W2.getPath() + "/" + node1.getName(); workspaceW2.clone(workspace.getName(), node1.getPath(), dstAbsPath, true); // there should not be any pending changes after clone assertFalse(superuserW2.hasPendingChanges()); }
/** * Operation is performed entirely within the persistent workspace, it does * not involve transient storage and therefore does not require a save */ public void testCopyNodes() throws RepositoryException { // copy referenceable node below non-referenceable node String dstAbsPath = node2W2.getPath() + "/" + node1.getName(); workspaceW2.copy(workspace.getName(), node1.getPath(), dstAbsPath); // there should not be any pending changes after copy assertFalse(superuserW2.hasPendingChanges()); }
private boolean hasSessionChanges() { Session session = UserSession.get().getJcrSession(); try { return session.hasPendingChanges(); } catch (RepositoryException e) { return false; } }
private boolean hasSessionChanges() { Session session = ((UserSession) org.apache.wicket.Session.get()).getJcrSession(); try { return session.hasPendingChanges(); } catch (RepositoryException e) { return false; } }
protected void save() throws RepositoryException { if (!umgr.isAutoSave() && superuser.hasPendingChanges()) { superuser.save(); } }
@Test public void repositoryIsNotClusteredAndClusterMaster() throws Exception { // GIVEN // WHEN ModuleManagerImpl moduleManager = new TestModuleManagerImpl(moduleVersionHandlers, context, moduleDefinitionReader, moduleRegistry, repositoryManager); moduleManager.applyDeltas(moduleDefinition, newArrayList(delta), context); // THEN assertThat(websiteSession.hasPendingChanges(), is(false)); }