Package org.odmg

Examples of org.odmg.Transaction.abort()


        storeObjects(tx, getNewODMGZoos("testUserRollbackWithCheckpoint", 10));
        // now we store objects to DB
        tx.checkpoint();
        storeObjects(tx, getNewProjects("testUserRollbackWithCheckpoint", 10));
        //we abort tx, all actions after the last checkpoint call should be rollback
        tx.abort();

        odmgZoosAfter = getDBObjectCountWithNewPB(ODMGZoo.class);
        projectsAfter = getDBObjectCountWithNewPB(ODMGGourmet.class);
        odmgZoosAfterOQL = getDBObjectCountViaOqlQueryUseNewTransaction(odmg, ODMGZoo.class);
        projectsAfterOQL = getDBObjectCountViaOqlQueryUseNewTransaction(odmg, ODMGGourmet.class);
View Full Code Here


        tx.lock(ro_2, Transaction.WRITE);
        ro_2 = new RollbackObjectOne();
        ro_2.setDescription(name);

        tx.abort();

        tx = odmg.newTransaction();
        tx.begin();
        query = odmg.newOQLQuery();
        query.create("select all from " + RollbackObjectOne.class.getName() + " where name like $1");
View Full Code Here

    public void testEmpty() throws Exception
    {
        // get new tx instance each time
        Transaction tx = odmg.newTransaction();
        tx.begin();
        tx.abort();

        tx = odmg.newTransaction();
        tx.begin();
        tx.checkpoint();
        tx.checkpoint();
View Full Code Here

        tx = odmg.newTransaction();
        tx.begin();
        tx.checkpoint();
        tx.checkpoint();
        tx.abort();

        tx = odmg.newTransaction();
        tx.begin();
        tx.checkpoint();
        tx.checkpoint();
View Full Code Here

        tx.commit();

        // with same tx instance
        tx = odmg.newTransaction();
        tx.begin();
        tx.abort();

        tx.begin();
        tx.checkpoint();
        tx.checkpoint();
        tx.abort();
View Full Code Here

        tx.abort();

        tx.begin();
        tx.checkpoint();
        tx.checkpoint();
        tx.abort();

        tx.begin();
        tx.checkpoint();
        tx.checkpoint();
        tx.commit();
View Full Code Here

    {
        try
        {
            Transaction tx = odmg.newTransaction();
            tx.begin();
            tx.abort();
            tx.abort();
        }
        catch(Exception e)
        {
            e.printStackTrace();
View Full Code Here

        try
        {
            Transaction tx = odmg.newTransaction();
            tx.begin();
            tx.abort();
            tx.abort();
        }
        catch(Exception e)
        {
            e.printStackTrace();
            fail("We allow to do multiple tx.abort calls, but this test fails with: " + e.getMessage());
View Full Code Here

            tx.commit();
            fail("A exception was expected");
        }
        catch(Exception e)
        {
            if(tx != null && tx.isOpen()) tx.abort();
        }
    }


    //**************************************************************
 
View Full Code Here

        }
        catch(QueryInvalidException iqe)
        {
            // we wait for this exception
            assertTrue(true);
            tx.abort();
        }
    }

    /**
     * test condition where start and end are the same.
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.