Package javax.jcr

Examples of javax.jcr.Node.lock()


        UserTransaction utx = new UserTransactionImpl(superuser);
        utx.begin();
        n.lock(false, true);

        // lock node in non-transactional session, too
        nOther.lock(false, true);

        // verify node is locked in both sessions
        assertTrue("Node locked in session 1", n.isLocked());
        assertTrue("Node locked in session 2", nOther.isLocked());
View Full Code Here


            UserTransaction utx = new UserTransactionImpl(superuser);
            utx.begin();
            n.lock(false, true);

            // lock node in non-transactional session, too
            nOther.lock(false, true);

            // verify node is locked in both sessions
            assertTrue("Node locked in session 1", n.isLocked());
            assertTrue("Node locked in session 2", nOther.isLocked());
            assertTrue("Node locked in session 2", nOther.hasProperty(jcrLockOwner));
View Full Code Here

        n.addMixin(mixLockable);
        n.addMixin(mixReferenceable);
        testRootNode.save();

        // lock this new node
        n.lock(false, true);
        assertTrue("Node locked in transaction", n.isLocked());

        // commit
        utx.commit();
       
View Full Code Here

        rootNode.save();

        String uuid = n.getUUID();
       
        // lock this new node
        Lock lock = n.lock(true, false);
        String lockToken = lock.getLockToken();
       
        // assert: session must get a non-null lock token
        assertNotNull("session must get a non-null lock token", lockToken);
View Full Code Here

        assertFalse("Node not locked", n.isLocked());

        // get user transaction object, start and lock node
        UserTransaction utx = new UserTransactionImpl(superuser);
        utx.begin();
        n.lock(false, true);

        // verify node is locked
        assertTrue("Node locked", n.isLocked());

        // unlock node
View Full Code Here

        testRootNode.save();

        // get user transaction object, start and lock node
        UserTransaction utx = new UserTransactionImpl(superuser);
        utx.begin();
        Lock lock = n.lock(false, true);

        // verify lock is live
        assertTrue("Lock live", lock.isLive());

        // rollback
View Full Code Here

        Node n = testRootNode.addNode(nodeName1);
        n.addMixin(mixLockable);
        n.addMixin(mixReferenceable);
        testRootNode.save();

        Lock lock = n.lock(false, true);

        // get user transaction object, start
        UserTransaction utx = new UserTransactionImpl(superuser);
        utx.begin();
View Full Code Here

        testRootNode.save();

        // get user transaction object, start and lock node
        UserTransaction utx = new UserTransactionImpl(superuser);
        utx.begin();
        Lock lock = n.lock(false, true);

        // verify that the lock properties have been created and are neither
        // NEW nor MODIFIED.
        assertTrue(n.hasProperty(jcrLockOwner));
        Property lockOwner = n.getProperty(jcrLockOwner);
View Full Code Here

        Node n = testRootNode.addNode(nodeName1);
        n.addMixin(mixLockable);
        n.addMixin(mixReferenceable);
        testRootNode.save();

        Lock lock = n.lock(false, true);
        try {
            // get user transaction object, start
            UserTransaction utx = new UserTransactionImpl(superuser);
            utx.begin();
View Full Code Here

        Node n = testRootNode.addNode(nodeName1);
        n.addMixin(mixLockable);
        n.addMixin(mixReferenceable);
        testRootNode.save();

        Lock lock = n.lock(false, true);

        // get user transaction object, start
        UserTransaction utx = new UserTransactionImpl(superuser);
        utx.begin();
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.