Package org.odmg

Examples of org.odmg.Transaction.begin()


        //***********************
        // do the procedure again
        odmgZoosBefore = getDBObjectCountWithNewPB(ODMGZoo.class);
        projectsBefore = getDBObjectCountWithNewPB(Project.class);
        // we reuse current tx
        tx.begin();
        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
View Full Code Here


    }

    protected int getDBObjectCountViaOqlQueryUseNewTransaction(Implementation odmg, Class target) throws Exception
    {
        Transaction tx = odmg.newTransaction();
        tx.begin();
        OQLQuery query = odmg.newOQLQuery();
        query.create("select allProjects from " + target.getName());
        List list = (List) query.execute();
        tx.commit();
        return list.size();
View Full Code Here

    }

    protected void deleteAll(Implementation odmg, Class target) throws Exception
    {
        Transaction tx = odmg.newTransaction();
        tx.begin();
        try
        {
            OQLQuery query = odmg.newOQLQuery();
            query.create("select allObjects from " + target.getName());
            List list = (List) query.execute();
View Full Code Here

    public void testDuplicateLocking() throws Exception
    {
        RollbackObjectOne ro = null;

        Transaction tx = odmg.newTransaction();
        tx.begin();
        ro = new RollbackObjectOne();
        ro.setName("test_step_1");
        tx.lock(ro, Transaction.WRITE);
        tx.lock(ro, Transaction.WRITE);
        tx.commit();
View Full Code Here

        ro.setName("test_step_1");
        tx.lock(ro, Transaction.WRITE);
        tx.lock(ro, Transaction.WRITE);
        tx.commit();

        tx.begin();
        tx.lock(ro, Transaction.WRITE);
        tx.lock(ro, Transaction.WRITE);
        ro.setName("test_step_2");
        tx.commit();
View Full Code Here

        tx.lock(ro, Transaction.WRITE);
        tx.lock(ro, Transaction.WRITE);
        ro.setName("test_step_2");
        tx.commit();

        tx.begin();
        tx.lock(ro, Transaction.WRITE);
        ro.setName("test_step_3");
        tx.lock(ro, Transaction.WRITE);
        tx.commit();
    }
View Full Code Here

        RollbackObjectOne ro = null;
        RollbackObjectOne ro_2 = null;
        String name = "testCheckCacheAfterRollback_"+System.currentTimeMillis();

        Transaction tx = odmg.newTransaction();
        tx.begin();
        ro = new RollbackObjectOne();
        ro.setName(name);
        tx.lock(ro, Transaction.WRITE);

        ro_2 = new RollbackObjectOne();
View Full Code Here

        ro_2.setName(name);
        tx.lock(ro_2, Transaction.WRITE);
        tx.commit();

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

        List list = (List) query.execute();
        tx.commit();
        assertEquals(2,list.size());

        tx = odmg.newTransaction();
        tx.begin();
        tx.lock(ro, Transaction.WRITE);
        ro = new RollbackObjectOne();
        ro.setDescription(name);

        tx.lock(ro_2, Transaction.WRITE);
View Full Code Here

        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");
        query.bind(name);
        list = (List) query.execute();
        tx.commit();
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.