Package org.odmg

Examples of org.odmg.Transaction.commit()


    tx.begin();
    database.makePersistent(father);
    database.makePersistent(mother);
    database.makePersistent(jimmy);
    database.makePersistent(joe);
    tx.commit();

        // read using id
    tx = odmg.newTransaction();
    tx.begin();
    query = odmg.newOQLQuery();
View Full Code Here


           " where (mother.id=$1 or father.id=$2)");
    query.bind(new Integer(motherID));
    query.bind(new Integer(fatherID));
    persons = (List) query.execute();
        assertEquals(2, persons.size());
    tx.commit();

        // read using firstname
        tx = odmg.newTransaction();
        tx.begin();
        query = odmg.newOQLQuery();
View Full Code Here

                     " where (mother.firstname=$1 or father.firstname=$2)");
        query.bind("mom");
        query.bind("dad");
        persons = (List) query.execute();
        assertEquals(2, persons.size());
        tx.commit();
  }

  public void testOrReferenceOnDifferentTables() throws Exception
  {
        deleteData(TestClassA.class);
View Full Code Here

    tx.begin();
    database.makePersistent(a1);
    database.makePersistent(a2);
    database.makePersistent(b1);
    database.makePersistent(b2);
    tx.commit();
    tx = odmg.newTransaction();
    tx.begin();
    // get the right values
    OQLQuery query = odmg.newOQLQuery();
    query.create("select a from " + TestClassA.class.getName());
View Full Code Here

           " where (b.oid=$1 or b.oid=$2)");
    query.bind(bID1);
    query.bind(bID2);
    As = (List) query.execute();
    assertTrue(As.size() == 2);
    tx.commit();
  }
}
View Full Code Here

        Transaction tx = odmg.newTransaction();
        tx.begin();
        db.makePersistent(coll_1);
        db.makePersistent(coll_2);
        tx.commit();

        tx.begin();
        ((TransactionExt)tx).getBroker().clearCache();
        OQLQuery query = odmg.newOQLQuery();
        query.create(queryStr);
View Full Code Here

            assertNotNull(gat);
            assertEquals("Gatherer_"+name, gat.getName());
            tx.lock(collectible, Transaction.WRITE);
            collectible.getGatherer().setName("New_"+name);
        }
        tx.commit();

        tx.begin();
        ((TransactionExt)tx).getBroker().clearCache();
        query = odmg.newOQLQuery();
        query.create(queryStr);
View Full Code Here

            assertNotNull(gat);
            assertEquals("New_"+name, gat.getName());
            tx.lock(collectible, Transaction.WRITE);
            collectible.setGatherer(null);
        }
        tx.commit();

        tx.begin();
        ((TransactionExt)tx).getBroker().clearCache();
        query = odmg.newOQLQuery();
        query.create(queryStr);
View Full Code Here

        {
            CollectibleA collectible = (CollectibleA) iterator.next();
            Gatherer gat = collectible.getGatherer();
            assertNull(gat);
        }
        tx.commit();
    }

    /**
     * Create object with 3 objects in associated collection.
     * We change one object of the collection
View Full Code Here

            kevin.setFather(dad);

            Transaction tx = odmg.newTransaction();
            tx.begin();
            tx.lock(kevin, Transaction.WRITE);
            tx.commit();

            tx = odmg.newTransaction();
            tx.begin();
            ((HasBroker) tx).getBroker().clearCache();
            OQLQuery qry = odmg.newOQLQuery();
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.