Package org.odmg

Examples of org.odmg.Transaction.begin()


        Implementation odmg = OJB.getInstance();
        Database db = odmg.newDatabase();
        //open database
        db.open(databaseName, Database.OPEN_READ_WRITE);
        Transaction tx = odmg.newTransaction();
        tx.begin();
        db.bind(odmg.newDList(), bindingName);

        foundList = (DList)db.lookup(bindingName);
        assertTrue("Could not found bound DList", foundList != null);
        foundList = null;
View Full Code Here


        }
        foundList = null;
        tx.commit();

        tx = odmg.newTransaction();
        tx.begin();
        try
        {
            DList newList = (DList)db.lookup(bindingName);
            db.unbind(bindingName);
        }
View Full Code Here

        // clear named roots.
        clearNRM();
        Transaction tx = odmg.newTransaction();
        //bind object to name
        tx.begin();
        Article example = createArticle();
        Identity oid = new Identity(example, ((HasBroker)tx).getBroker());

        try
        {
View Full Code Here

        }

        // TestThreadsNLocks look up
        Article lookedUp1 = null;
        tx = odmg.newTransaction();
        tx.begin();

        try
        {
            // lookup by name binding
            lookedUp1 = (Article) db.lookup(bindingName);
View Full Code Here

        // looking up object by OID should return same Object as by name
        assertEquals("lookups should return identical object", example, lookedUp1);

        try
        {
            tx.begin();
            db.unbind(bindingName);
            tx.commit();
        }
        catch (ObjectNameNotFoundException ex)
        {
View Full Code Here

        // clear named roots.
        clearNRM();

        Transaction tx = odmg.newTransaction();
        // 1. perform binding
        tx.begin();

        Article example = createArticle();

        try
        {
View Full Code Here

            fail(ex.getMessage());
        }

        // 2. perform unbind
        tx = odmg.newTransaction();
        tx.begin();
        try
        {
            db.unbind(name);
            tx.commit();
        }
View Full Code Here

            fail("name " + name + "should be known");
        }

        // 3. check if name is really unknown now
        tx = odmg.newTransaction();
        tx.begin();
        try
        {
            Article value = (Article) db.lookup(name);
        }
        catch (ObjectNameNotFoundException ex)
View Full Code Here

    {
        long timestamp = System.currentTimeMillis();
        try
        {
            Transaction tx = odmg.newTransaction();
            tx.begin();
            Master master_1 = populatedMasterFKnoPK(tx, 5, timestamp);
            Master master_2 = populatedMasterFKnoPK(tx, 5, timestamp);

            database.makePersistent(master_1);
            database.makePersistent(master_2);
View Full Code Here

    {
        final long timestamp = System.currentTimeMillis();
        try
        {
            Transaction tx = odmg.newTransaction();
            tx.begin();

            Master master_1 = populatedMasterFKinPK(tx, 5, timestamp);
            Master master_2 = populatedMasterFKinPK(tx, 5, timestamp);

            database.makePersistent(master_1);
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.