Package org.odmg

Examples of org.odmg.Transaction.commit()


            DCollection check = (DCollection) query.execute();

            assertEquals(results, check);

            tx.commit();
        }
                // close database
        finally
        {
            db.close();
View Full Code Here


            cld.setTableName("ELVIS");
            broker.getDescriptorRepository().setClassDescriptor(cld);

            //broker will crash as metadata is corrupt
            a.addToStock(5);
            tx.commit();
            fail("Can commit tx with corrupt metadata");
        }
        catch (Throwable t)
        {
            //ignore
View Full Code Here

        database.deletePersistent(pg1);
        database.deletePersistent(a2);
        database.deletePersistent(pg2);

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

        storeObjects(tx_1, getNewODMGZoos(5));
        storeObjects(tx_1, getNewProjects(3));
        //store more
        storeObjects(tx_1, getNewODMGZoos(5));
        storeObjects(tx_1, getNewProjects(2));
        tx_1.commit();

        Transaction tx_2 = odmg_2.newTransaction();
        tx_2.begin();
        //store
        storeObjects(tx_2, getNewFarAways(9));
View Full Code Here

        tx_2.begin();
        //store
        storeObjects(tx_2, getNewFarAways(9));
        //store more
        storeObjects(tx_2, getNewFarAways(11));
        tx_2.commit();

        int odmgZoosAfter = getDBObjectCountWithNewPB(((DatabaseImpl) db_1).getPBKey(), ODMGZoo.class);
        int projectsAfter = getDBObjectCountWithNewPB(((DatabaseImpl) db_1).getPBKey(), Project.class);
        int farAwaysAfter = getDBObjectCountWithNewPB(((DatabaseImpl) db_2).getPBKey(), FarAwayClass.class);
        int odmgZoosAfterOQL = getDBObjectCountViaOqlQueryUseNewTransaction(odmg_1, ODMGZoo.class);
View Full Code Here

        tx_2.begin();
        //store
        storeObjects(tx_2, getNewFarAways(9));
        //store more
        storeObjects(tx_2, getNewFarAways(11));
        tx_2.commit();

        odmgZoosAfter = getDBObjectCountWithNewPB(((DatabaseImpl) db_1).getPBKey(), ODMGZoo.class);
        projectsAfter = getDBObjectCountWithNewPB(((DatabaseImpl) db_1).getPBKey(), Project.class);
        farAwaysAfter = getDBObjectCountWithNewPB(((DatabaseImpl) db_2).getPBKey(), FarAwayClass.class);
        odmgZoosAfterOQL = getDBObjectCountViaOqlQueryUseNewTransaction(odmg_1, ODMGZoo.class);
View Full Code Here

    {
        Transaction tx_1 = odmg_1.newTransaction();
        tx_1.begin();
        deleteObjects(db_1, getAllObjects(odmg_1, ODMGZoo.class));
        deleteObjects(db_1, getAllObjects(odmg_1, Project.class));
        tx_1.commit();

        Transaction tx_2 = odmg_2.newTransaction();
        tx_2.begin();
        deleteObjects(db_2, getAllObjects(odmg_2, FarAwayClass.class));
        tx_2.commit();
View Full Code Here

        tx_1.commit();

        Transaction tx_2 = odmg_2.newTransaction();
        tx_2.begin();
        deleteObjects(db_2, getAllObjects(odmg_2, FarAwayClass.class));
        tx_2.commit();

        int odmgZoosAfter = getDBObjectCountWithNewPB(((DatabaseImpl) db_1).getPBKey(), ODMGZoo.class);
        int projectsAfter = getDBObjectCountWithNewPB(((DatabaseImpl) db_1).getPBKey(), Project.class);
        int farAwaysAfter = getDBObjectCountWithNewPB(((DatabaseImpl) db_2).getPBKey(), FarAwayClass.class);
        //
View Full Code Here

        Transaction tx = ojb.newTransaction();
        tx.begin();
        OQLQuery query = ojb.newOQLQuery();
        query.create("select allProjects from " + target.getName());
        List list = (List) query.execute();
        tx.commit();
        return list.size();
    }

    protected int getDBObjectCountViaOqlQuery(Implementation ojb, Class target) throws Exception
    {
View Full Code Here

            result = (List) query.execute();
            before = result.size();

            database.makePersistent(child);

            tx.commit();

            tx.begin();
            query = odmg.newOQLQuery();
            query.create(strQuery);
            result = (List) query.execute();
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.