Package javax.jcr

Examples of javax.jcr.Session.refresh()


            targetNode.setProperty(propName2, v);
            s.save();
            fail("Hold present must prevent the target node from having new properties set.");
        } catch (RepositoryException e) {
            // success
            s.refresh(false);
        }

        NodeType[] mixins = targetNode.getMixinNodeTypes();
        if (mixins.length > 0) {
            try {
View Full Code Here


                targetNode.removeMixin(mixins[0].getName());
                s.save();
                fail("Hold present must prevent the target node from having it's mixin types changed.");
            catch (RepositoryException e) {
                // success
                s.refresh(false);
            }
        }
        try {
            targetNode.remove();
            s.save();
View Full Code Here

            targetNode.remove();
            s.save();
            fail("Hold present must prevent the target node from being removed.");
        } catch (RepositoryException e) {
            // success
            s.refresh(false);
        }
    }

    private void assertNoEffect(Node target, String childName, String propName) throws RepositoryException {
        Session s = target.getSession();
View Full Code Here

                fail("Node.setPrimaryType(String) must throw ConstraintViolationException if the specified node type name refers to a mixin.");
            } catch (ConstraintViolationException e) {
                // success
            } finally {
                // reset the changes.
                session.refresh(false);
            }
        }
    }

    /**
 
View Full Code Here

                    fail("Node.setPrimaryType(String) must throw ConstraintViolationException if the specified node type name refers to an abstract node type.");
                } catch (ConstraintViolationException e) {
                    // success
                } finally {
                    // reset the changes.
                    session.refresh(false);
                }
            }
        }
    }
View Full Code Here

            } catch (PathNotFoundException e) {
                // success
            }

            // revert all transient modifications
            rw.refresh(false);
            Property pAgain = (Property) rw.getItem(prop1Path);

            // TODO: for generic jsr 170 test: change assert to p.isSame(pAgain)
            assertSame(p, pAgain);
            assertEquals("string1", p.getString());
View Full Code Here

        // Otherwise clean up the session if there are any pending changes.
        // Those changes are not persisted, but dropped. If this fails, the
        // session is logged out and not returned/added to the pool
        try {
            if (session.hasPendingChanges()) {
                session.refresh(false);
            }
        } catch (RepositoryException re) {
            log.info("Cannot check or drop pending changes of session " +
                "{}, logging out", userId);
            this.poolDropCounter++;
View Full Code Here

                            "Problem loading initial content of bundle "
                                + bundle.getSymbolicName() + " ("
                                + bundle.getBundleId() + ")", t);
                    } finally {
                        if ( session.hasPendingChanges() ) {
                            session.refresh(false);
                        }
                    }
                } else {
                    ignored++;
                }
View Full Code Here

            response.setError(e);

        } finally {
            try {
                if (session.hasPendingChanges()) {
                    session.refresh(false);
                }
            } catch (RepositoryException e) {
                log.warn("RepositoryException in finally block: {}",
                    e.getMessage(), e);
            }
View Full Code Here

                + getClass().getName(), throwable);
            htmlResponse.setError(throwable);
        } finally {
            try {
                if (session.hasPendingChanges()) {
                    session.refresh(false);
                }
            } catch (RepositoryException e) {
                log.warn("RepositoryException in finally block: {}",
                    e.getMessage(), e);
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.