Package org.odmg

Examples of org.odmg.Transaction.abort()


        }
        catch (Exception e)

        {
            tx.abort();
            throw e;
        }

        // close database
        try
View Full Code Here


            tx.commit();
        }
        catch (Exception ex)

        {
            tx.abort();
            fail("ODMGException: " + ex.getMessage());
        }

        // close database
        try
View Full Code Here

        }
        finally
        {
            if (tx != null && tx.isOpen())
            {
                tx.abort();
            }
        }

        int after = result.size();
View Full Code Here

        }
        finally
        {
            if (tx != null && tx.isOpen())
            {
                tx.abort();
            }
        }

        int after = result.size();
View Full Code Here

        Transaction tx = odmg.newTransaction();
        tx.begin();
        storeObjects(tx, getNewODMGZoos("testUserRollback", 10));
        storeObjects(tx, getNewProjects("testUserRollback", 10));
        //we abort tx
        tx.abort();

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

        tx.begin();
        storeObjects(tx, getNewODMGZoos("testUserRollback", 10));
        storeObjects(tx, getNewProjects("testUserRollback", 10));
        //we abort tx
        tx.abort();

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

        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();

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

        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(Project.class);
        odmgZoosAfterOQL = getDBObjectCountViaOqlQueryUseNewTransaction(odmg, ODMGZoo.class);
        projectsAfterOQL = getDBObjectCountViaOqlQueryUseNewTransaction(odmg, Project.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

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.