Package org.odmg

Examples of org.odmg.Transaction.commit()


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

    public void testCheckCacheAfterRollback() throws Exception
    {
        RollbackObjectOne ro = null;
View Full Code Here


        tx.lock(ro, Transaction.WRITE);

        ro_2 = new RollbackObjectOne();
        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");
View Full Code Here

        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();
        assertEquals(2,list.size());

        tx = odmg.newTransaction();
        tx.begin();
        tx.lock(ro, Transaction.WRITE);
View Full Code Here

        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();
        assertEquals(2,list.size());
        assertNull(((RollbackObjectOne)list.get(0)).getDescription());
        assertNull(((RollbackObjectOne)list.get(1)).getDescription());

        // after tx another tx should be able to lock these objects
View Full Code Here

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

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

        tx.checkpoint();
        tx.commit();

        tx = odmg.newTransaction();
        tx.begin();
        tx.commit();

        // with same tx instance
        tx = odmg.newTransaction();
        tx.begin();
        tx.abort();
View Full Code Here

        tx.abort();

        tx.begin();
        tx.checkpoint();
        tx.checkpoint();
        tx.commit();

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

        tx.checkpoint();
        tx.checkpoint();
        tx.commit();

        tx.begin();
        tx.commit();
    }

    public void testDoubleAbortTxCall() throws Exception
    {
        try
View Full Code Here

            ro.setName(name);
            tx.lock(ro, Transaction.WRITE);
            // this should fail
            tx.lock(new Exception(), Transaction.WRITE);

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

    Iterator it = allTargets.iterator();
    while (it.hasNext())
    {
      database.deletePersistent(it.next());
    }
    tx.commit();
  }

    /**
     * test joins on same table
     *
 
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.