Package org.odmg

Examples of org.odmg.Transaction.begin()


        Transaction tx = odmg.newTransaction();

        //perform transaction
        try
        {
            tx.begin();

            OQLQuery query = odmg.newOQLQuery();
            query.create("select anArticle from " + Article.class.getName() + " where articleId = $678");
            query.bind(new Integer(30));
View Full Code Here


        Transaction tx = odmg.newTransaction();

        //perform transaction
        try
        {
            tx.begin();
            OQLQuery query = odmg.newOQLQuery();
            query.create("select aLotOfArticles from " + Article.class.getName() + " where productGroupId = 4");

            DCollection results = (DCollection) query.execute();
            results = results.query("price > 35");
View Full Code Here

            fail("ODMGException: " + ex.getMessage());
        }
        try
        {
            Transaction tx = odmg.newTransaction();
            tx.begin();

            // retrieve an Article
            OQLQuery query = odmg.newOQLQuery();
            query.create("select anArticle from " + Article.class.getName() + " where articleId = $678");
            query.bind(new Integer(30));
View Full Code Here

    {
        // TODO: fix this!
        if(ojbSkipKnownIssueProblem()) return;

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

        ProductGroup pg1 = new ProductGroup();
        pg1.setName("BatchModeTest ProductGroup #1");
        database.makePersistent(pg1);
View Full Code Here

        int odmgZoosBefore = getDBObjectCountWithNewPB(((DatabaseImpl) db_1).getPBKey(), ODMGZoo.class);
        int projectsBefore = getDBObjectCountWithNewPB(((DatabaseImpl) db_1).getPBKey(), Project.class);
        int farAwaysBefore = getDBObjectCountWithNewPB(((DatabaseImpl) db_2).getPBKey(), FarAwayClass.class);

        Transaction tx_1 = odmg_1.newTransaction();
        tx_1.begin();
        //store
        storeObjects(tx_1, getNewODMGZoos(5));
        storeObjects(tx_1, getNewProjects(3));
        //store more
        storeObjects(tx_1, getNewODMGZoos(5));
View Full Code Here

        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));
        //store more
        storeObjects(tx_2, getNewFarAways(11));
        tx_2.commit();
View Full Code Here

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

        tx_2.begin();
        //store
        storeObjects(tx_2, getNewFarAways(9));
        //store more
        storeObjects(tx_2, getNewFarAways(11));
        tx_2.commit();
View Full Code Here

    }

    public void testDelete() throws Exception
    {
        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();
View Full Code Here

        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();

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

    }

    protected int getDBObjectCountViaOqlQueryUseNewTransaction(Implementation ojb, Class target) throws Exception
    {
        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();
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.