Package javax.jcr

Examples of javax.jcr.Session.refresh()


        session.save();
               
      } catch (Throwable e) {
        monitor.log().i(e);
        try {
          session.refresh(false);
        } catch (RepositoryException e1) {
          monitor.log().i(e);
        }
//        throw new CaoException(e);
      }
View Full Code Here


        sources.getConnection().fireElementStructurChanged(source.getId());
       
      } catch (Throwable e) {
        monitor.log().i(e);
        try {
          session.refresh(false);
        } catch (RepositoryException e1) {
          monitor.log().i(e);
        }
//        throw new CaoException(e);
      }
View Full Code Here

      return postEntry(title, summary, updated, authors,
                          content, session, collectionNode,
                          resourceName, 0);
    } catch (RepositoryException e) {
      try {
        session.refresh(false);
      } catch (Throwable t) {
        log.warn(t);
      }     
      throw new ResponseContextException(500, e);
    }
View Full Code Here

    try {
      getNode(session, resourceName).remove();
      session.save();
    } catch (RepositoryException e) {
      try {
        session.refresh(false);
      } catch (Throwable t) {
        log.warn(t);
      }           
      throw new ResponseContextException(500, e);
    }
View Full Code Here

        Node node = session.getNode("/");
        node.addNode("source").addNode("node");
        node.addNode("target");
        session.save();

        session.refresh(true);
        Node sourceNode = session.getNode("/source/node");
        session.move("/source/node", "/target/moved");
        // assertEquals("/target/moved", sourceNode.getPath());  // passes on JR2, fails on Oak
        try {
            sourceNode.getPath();
View Full Code Here

        Node node = session.getNode("/");
        node.addNode("source").addNode("node");
        node.addNode("target");
        session.save();

        session.refresh(true);
        Node sourceNode = session.getNode("/source/node");
        session.move("/source/node", "/target/moved");
        // assertEquals("/target/moved", sourceNode.getPath());  // passes on JR2, fails on Oak
        try {
            sourceNode.getPath();
View Full Code Here

        Item property1 = session.getProperty("/node1/node3/property1");
        assertFalse(property1.isNode());
        assertEquals("value1", ((Property) property1).getString());

        // Make sure these items are still accessible after refresh(true);
        session.refresh(true);
        assertTrue(session.itemExists("/node1"));
        assertTrue(session.itemExists("/node1/node2"));
        assertTrue(session.itemExists("/node1/node3"));
        assertTrue(session.itemExists("/node1/node3/property1"));
View Full Code Here

        assertTrue(session.itemExists("/node1"));
        assertTrue(session.itemExists("/node1/node2"));
        assertTrue(session.itemExists("/node1/node3"));
        assertTrue(session.itemExists("/node1/node3/property1"));

        session.refresh(false);
        // Make sure these items are not accessible after refresh(false);
        assertFalse(session.itemExists("/node1"));
        assertFalse(session.itemExists("/node1/node2"));
        assertFalse(session.itemExists("/node1/node3"));
        assertFalse(session.itemExists("/node1/node3/property1"));
View Full Code Here

            session1.save();
            assertTrue(session1.getRootNode().hasNode("node"));
            assertTrue(session2.getRootNode().hasNode("node"));

            session2.refresh(true);
            assertTrue(session1.getRootNode().hasNode("node"));
            assertTrue(session2.getRootNode().hasNode("node"));

            try {
                session2.save();
View Full Code Here

        Node node = getNode(TEST_PATH);
        Node source = node.addNode("source").addNode("node");
        node.addNode("target");
        session.save();

        session.refresh(true);
        session.move(TEST_PATH + "/source/node", TEST_PATH + "/target/moved");
        assertEquals(TEST_PATH + "/target/moved", source.getPath());

        assertFalse(node.hasNode("source/node"));
        assertTrue(node.hasNode("source"));
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.