Package org.odmg

Examples of org.odmg.Transaction.commit()


        assertEquals(
                "children's names are equal",
                Arrays.asList(getFirstNames(returnedChildren)),
                Arrays.asList(getFirstNames(children)));
        // System.out.println(Arrays.asList(getFirstNames(returnedChildren)));
        tx.commit();

        /*
         delete father then children
         fk-constraints?
         */
 
View Full Code Here


         */
        tx.begin();
        database.deletePersistent(returnedFather.getChildren()[0]);
        database.deletePersistent(returnedFather.getChildren()[1]);
        database.deletePersistent(returnedFather);
        tx.commit();

        qry = odmg.newOQLQuery();
        qry.create("select a from " + PersonImpl.class.getName() + " where firstname=$1");
        qry.bind(firstnameFather);
        result = (Collection) qry.execute();
View Full Code Here

        persistentStoreObjects(database, getNewODMGZoos("testResultsAfterTransaction", 5));
        persistentStoreObjects(database, getNewProjects("testResultsAfterTransaction", 3));
        //store more
        storeObjects(tx, getNewODMGZoos("testResultsAfterTransaction", 5));
        storeObjects(tx, getNewProjects("testResultsAfterTransaction", 2));
        tx.commit();

        int odmgZoosAfter = getDBObjectCountWithNewPB(ODMGZoo.class);
        int projectsAfter = getDBObjectCountWithNewPB(Project.class);
        int odmgZoosAfterOQL = getDBObjectCountViaOqlQueryUseNewTransaction(odmg, ODMGZoo.class);
        int projectsAfterOQL = getDBObjectCountViaOqlQueryUseNewTransaction(odmg, Project.class);
View Full Code Here

        persistentStoreObjects(database, getNewODMGZoos("testResultsAfterTransaction", 5));
        persistentStoreObjects(database, getNewProjects("testResultsAfterTransaction", 3));
        //store more
        storeObjects(tx, getNewODMGZoos("testResultsAfterTransaction", 5));
        storeObjects(tx, getNewProjects("testResultsAfterTransaction", 2));
        tx.commit();

        odmgZoosAfter = getDBObjectCountWithNewPB(ODMGZoo.class);
        projectsAfter = getDBObjectCountWithNewPB(Project.class);
        odmgZoosAfterOQL = getDBObjectCountViaOqlQueryUseNewTransaction(odmg, ODMGZoo.class);
        projectsAfterOQL = getDBObjectCountViaOqlQueryUseNewTransaction(odmg, Project.class);
View Full Code Here

        persistentStoreObjects(database, getNewODMGZoos("testResultsAfterTransactionWithClearedCache", 5));
        persistentStoreObjects(database, getNewProjects("testResultsAfterTransactionWithClearedCache", 3));
        //store more
        storeObjects(tx, getNewODMGZoos("testResultsAfterTransactionWithClearedCache", 5));
        storeObjects(tx, getNewProjects("testResultsAfterTransactionWithClearedCache", 2));
        tx.commit();

        //###### hack we clear cache of PB ########
        PersistenceBroker tmp = PersistenceBrokerFactory.defaultPersistenceBroker();
        tmp.clearCache();
        tmp.close();
View Full Code Here

        persistentStoreObjects(database, getNewODMGZoos("testResultsAfterTransactionWithClearedCache", 5));
        persistentStoreObjects(database, getNewProjects("testResultsAfterTransactionWithClearedCache", 3));
        //store more
        storeObjects(tx, getNewODMGZoos("testResultsAfterTransactionWithClearedCache", 5));
        storeObjects(tx, getNewProjects("testResultsAfterTransactionWithClearedCache", 2));
        tx.commit();

        //###### hack we clear cache of PB ########
        tmp = PersistenceBrokerFactory.defaultPersistenceBroker();
        tmp.clearCache();
        tmp.close();
View Full Code Here

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

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

                database.deletePersistent(obj);
            }
        }
        finally
        {
            tx.commit();
        }
    }

    // user described test case
    public void testDuplicateLocking() throws Exception
View Full Code Here

        tx.begin();
        ro = new RollbackObjectOne();
        ro.setName("test_step_1");
        tx.lock(ro, Transaction.WRITE);
        tx.lock(ro, Transaction.WRITE);
        tx.commit();

        tx.begin();
        tx.lock(ro, Transaction.WRITE);
        tx.lock(ro, Transaction.WRITE);
        ro.setName("test_step_2");
View Full Code Here

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

        tx.begin();
        tx.lock(ro, Transaction.WRITE);
        ro.setName("test_step_3");
        tx.lock(ro, Transaction.WRITE);
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.