Examples of rollbackToSavePoint()


Examples of org.apache.openjpa.persistence.OpenJPAEntityManager.rollbackToSavepoint()

        pm.setSavepoint("test");
        pm.setSavepoint("test2");
        pm.setSavepoint("after");
        pm.setSavepoint("after2");
        if (rollback)
            pm.rollbackToSavepoint("test2");
        else
            pm.releaseSavepoint("test2");

        assertFlags("before", 0, RELEASED | ROLLBACK);
        assertFlags("before2", 0, RELEASED | ROLLBACK);
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAEntityManager.rollbackToSavepoint()

        else
            assertFlags("test2", RELEASED | USER, 0);

        pm.setSavepoint("after3");
        if (rollback)
            pm.rollbackToSavepoint("test");
        else
            pm.releaseSavepoint("test");

        assertFlags("before", 0, RELEASED | ROLLBACK);
        assertFlags("before2", 0, RELEASED | ROLLBACK);
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAEntityManager.rollbackToSavepoint()

            assertNotEquals(orig, getModifiedValue(t2));

            em.rollbackToSavepoint("foo");
            assertEquals(orig, getModifiedValue(t));

            em2.rollbackToSavepoint("foo");
            assertEquals(orig, getModifiedValue(t2));
        } finally {
            close(em);
            close(em2);
        }
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAEntityManager.rollbackToSavepoint()

            assertNotEquals(orig, getModifiedValue(t2));

            em.rollbackToSavepoint("foo");
            assertEquals(orig, getModifiedValue(t));

            em2.rollbackToSavepoint("foo");
            assertEquals(orig, getModifiedValue(t2));
        } finally {
            close(em);
            close(em2);
        }
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAEntityManager.rollbackToSavepoint()

        pm.setSavepoint("s1");
        pc = pm.find(ModRuntimeTest1.class, oid);
        assertTrue(pm.isTransactional(pc));
        pm.setSavepoint("s2");
        pc.setStringField("bar");
        pm.rollbackToSavepoint("s2");
        assertEquals("orig", pc.getStringField());
        assertTrue(pm.isTransactional(pc));

        rollbackTx(pm);
        endEm(pm);
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAEntityManager.rollbackToSavepoint()

        pc.setStringField("s1");
        pm.setSavepoint("s1");
        pc.setStringField("s2");
        pm.setSavepoint("s2");
        pc.setStringField("diff");
        pm.rollbackToSavepoint();
        assertEquals("s2", pc.getStringField());
        pm.releaseSavepoint();
        try {
            pm.rollbackToSavepoint("s1");
            fail("Exhausted.");
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAEntityManager.rollbackToSavepoint()

        pc.setStringField("diff");
        pm.rollbackToSavepoint();
        assertEquals("s2", pc.getStringField());
        pm.releaseSavepoint();
        try {
            pm.rollbackToSavepoint("s1");
            fail("Exhausted.");
        } catch (Exception e) {
        }
        rollbackTx(pm);
        endEm(pm);
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAEntityManager.rollbackToSavepoint()

        for (int i = 0; i < after; i++) {
            pm.persist(new ModRuntimeTest1());
            pm.setSavepoint("after" + i);
        }

        pm.rollbackToSavepoint("test");
        assertEquals("orig", pc.getStringField());
        assertFalse(pm.isPersistent(pc));
        assertEquals(before, pm.getTransactionalObjects().size());
        endTx(pm);
        endEm(pm);
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAEntityManager.rollbackToSavepoint()

        for (int i = 0; i < after; i++) {
            pc.setSelfOneOne(new ModRuntimeTest1());
            pm.setSavepoint("after" + i);
        }

        pm.rollbackToSavepoint("test");
        assertEquals("orig", pc.getStringField());
        assertFalse(pm.isPersistent(pc2));
        if (before > 0)
            assertEquals("before" + (before - 1),
                pc.getSelfOneOne().getStringField());
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAEntityManager.rollbackToSavepoint()

        for (int i = 0; i < after; i++) {
            pc.setSelfOneOne(new ModRuntimeTest1());
            pm.setSavepoint("after" + i);
        }

        pm.rollbackToSavepoint("test");
        assertEquals("orig", pc.getStringField());
        if (before > 0)
            assertEquals("before" + (before - 1),
                pc.getSelfOneOne().getStringField());
        else
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.