Package org.apache.jackrabbit.core

Examples of org.apache.jackrabbit.core.UserTransactionImpl.begin()


        tx.commit();

        // new session
        Session session = getHelper().getSuperuserSession();
        tx = new UserTransactionImpl(session);
        tx.begin();
        session.getWorkspace().getVersionManager().checkin(path);
        tx.commit();
    }

    /**
 
View Full Code Here


        addEventListener(listener, Event.NODE_ADDED);

        // use a transaction
        UserTransaction utx = new UserTransactionImpl(superuser);
        // start transaction
        utx.begin();
        Version v = n1.checkin();
        // commit transaction
        utx.commit();

        removeEventListener(listener);
View Full Code Here

        addEventListener(listener, Event.NODE_REMOVED);

        // use a transaction
        UserTransaction utx = new UserTransactionImpl(superuser);
        // start transaction
        utx.begin();
        v.getContainingHistory().removeVersion(v.getName());
        // commit transaction
        utx.commit();

        removeEventListener(listener);
View Full Code Here

    public void testRestoreWithXA() throws Exception {
        Node n = testRootNode.addNode(nodeName1);
        n.addMixin(mixVersionable);
        testRootNode.save();
        UserTransactionImpl tx = new UserTransactionImpl(superuser);
        tx.begin();
        Version v10 = n.checkin();
        String versionName = v10.getName();
        n.restore(v10, true);
        assertEquals("Wrong version restored", versionName, n.getBaseVersion().getName());
        tx.commit();
View Full Code Here

*/
public class RemoveAndAddVersionLabelXATest extends AbstractJCRTest {

    public void testVersionLabel() throws Exception {
        UserTransaction tx = new UserTransactionImpl(superuser);
        tx.begin();
        Node n = testRootNode.addNode(nodeName1);
        n.addMixin(mixVersionable);
        testRootNode.save();
        String v1 = n.checkin().getName();
        n.checkout();
View Full Code Here

        String v2 = n.checkin().getName();
        n.getVersionHistory().addVersionLabel(v2, "label", false);
        tx.commit();

        tx = new UserTransactionImpl(superuser);
        tx.begin();
        n.restore(v1, false);
        n.getVersionHistory().removeVersion(v2);
        n.checkout();
        v2 = n.checkin().getName();
        n.getVersionHistory().addVersionLabel(v2, "label", false);
View Full Code Here

    public void testCheckinRemoveVersionWithXA() throws Exception {
        Node n = testRootNode.addNode(nodeName1);
        n.addMixin(mixVersionable);
        testRootNode.save();
        UserTransactionImpl tx = new UserTransactionImpl(superuser);
        tx.begin();
        try {
            Version v10 = n.checkin();
            assertTrue("Version.getReferences() must return base version", v10.getReferences().hasNext());
            try {
                n.getVersionHistory().removeVersion(v10.getName());
View Full Code Here

        addEventListener(listener, Event.NODE_ADDED);

        // use a transaction
        UserTransaction utx = new UserTransactionImpl(superuser);
        // start transaction
        utx.begin();
        Version v = n1.checkin();
        // commit transaction
        utx.commit();

        removeEventListener(listener);
View Full Code Here

        addEventListener(listener, Event.NODE_REMOVED);

        // use a transaction
        UserTransaction utx = new UserTransactionImpl(superuser);
        // start transaction
        utx.begin();
        v.getContainingHistory().removeVersion(v.getName());
        // commit transaction
        utx.commit();

        removeEventListener(listener);
View Full Code Here

    }

    public NodeIterator execute() throws Exception {
        UserTransactionImpl tx = new UserTransactionImpl(getSession());
        log.info("begin transaction");
        tx.begin();
        NodeIterator it = op.execute();
        log.info("commit transaction");
        tx.commit();
        return it;
    }
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.