Package org.exolab.castor.jdo

Examples of org.exolab.castor.jdo.Database.rollback()


        laptop.setName("laptop 1");

        database.begin();
        database.update(laptop);
        database.rollback();
       
        database.begin();
        laptop = (Laptop) database.load(Laptop.class, new Integer(1));
        database.commit();
View Full Code Here


                                + person.getValue1() + ", expected: " + expectedValue);
                        valid = false;
                    }
                }
            }
            db.rollback();
            db.close();
        } catch (Exception e) {
            if (db != null) {
                try {
                    db.close();
View Full Code Here

        db.begin();
        parent = (Lazy1to1Parent ) db.load(Lazy1to1Parent.class, new Integer (20000));
        child = parent.getChild();
        assertNotNull(child);
        assertEquals(1, child.getId().intValue());
        db.rollback();
       
        db.begin();
        parent = (Lazy1to1Parent) db.load(Lazy1to1Parent.class, new Integer (20000));
        db.remove(parent);
        db.commit();
View Full Code Here

        db.commit();

        // re-load to assert that nothing has changed
        db.begin();
        parent = (Lazy1to1Parent) db.load(Lazy1to1Parent.class, new Integer (1));
        db.rollback();

        assertParent(parent, 1, "parent 1");
        assertChild(parent.getChild(), 1, "child 1");

        db.close();
View Full Code Here

        db.commit();

        db.begin();
        child = (Lazy1to1Child) db.load(Lazy1to1Child.class, new Integer (2));
        assertChild(child, 2, "child 22");
        db.rollback();

        db.begin();
        child = (Lazy1to1Child) db.load(Lazy1to1Child.class, new Integer (2));
        assertChild(child, 2, "child 22");
        child.setDescription("child 2");
View Full Code Here

        db.commit();

        db.begin();
        child = (Lazy1to1Child) db.load(Lazy1to1Child.class, new Integer (2));
        assertChild(child, 2, "child 2");
        db.rollback();

        db.close();
    }

    public void testUpdateParentMemberWithAccess() throws Exception {
View Full Code Here

        db.begin();
        parent = (Lazy1to1Parent) db.load(Lazy1to1Parent.class, new Integer (1));
        assertParent(parent, 1, "parent 11");
        child = parent.getChild();
        assertChild(child, 1, "child 1");
        db.rollback();

        db.begin();
        parent = (Lazy1to1Parent) db.load(Lazy1to1Parent.class, new Integer (1));
        assertParent(parent, 1, "parent 11");
        child = parent.getChild();
View Full Code Here

        db.begin();
        parent = (Lazy1to1Parent) db.load(Lazy1to1Parent.class, new Integer (1));
        assertParent(parent, 1, "parent 1");
        child = parent.getChild();
        assertChild(child, 1, "child 1");
        db.rollback();

        db.close();
    }

    public void testUpdateParentMemberWithoutAccess() throws Exception {
View Full Code Here

       
        db.begin();
        parent = (Lazy1to1Parent) db.load(Lazy1to1Parent.class, new Integer (1));
        assertParent(parent, 1, "parent 1");
        assertNull(parent.getChild());
        db.rollback();

        db.begin();
        parent = (Lazy1to1Parent) db.load(Lazy1to1Parent.class, new Integer (1));
        assertParent(parent, 1, "parent 1");
        childNew = (Lazy1to1Child) db.load(Lazy1to1Child.class, new Integer (1));
View Full Code Here

        db.begin();
        parent = (Lazy1to1Parent) db.load(Lazy1to1Parent.class, new Integer (1));
        assertParent(parent, 1, "parent 1");
        assertChild(parent.getChild(), 1, "child 1");
        db.rollback();

        db.close();
    }

    private void assertParent(final Lazy1to1Parent account,
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.