Package org.odmg

Examples of org.odmg.Transaction.begin()


    protected void setUp() throws Exception
    {
        super.setUp();
        Transaction tx = odmg.newTransaction();
        tx.begin();
        testProductGroup = new ProductGroup();
        testProductGroup.setGroupName("NamedRootsTest_" + System.currentTimeMillis());
        database.makePersistent(testProductGroup);
        tx.commit();
    }
View Full Code Here


        Article article = createArticle();
        Article foundArticle = null;

        Transaction tx = odmg.newTransaction();
        tx.begin();
        database.bind(article, bindingName);

        foundArticle = (Article) database.lookup(bindingName);
        assertNotNull(foundArticle);
View Full Code Here

        foundArticle = null;
        tx.commit();

        tx = odmg.newTransaction();
        tx.begin();
        foundArticle = (Article) database.lookup(bindingName);
        assertNotNull(foundArticle);
        database.unbind(bindingName);
        tx.commit();
    }
View Full Code Here

    {
        String name = "testUnBind_" + System.currentTimeMillis();

        Transaction tx = odmg.newTransaction();
        //bind object to name
        tx.begin();
        Article example = createArticle();
        database.makePersistent(example);
        tx.commit();

        // 1. perform binding
View Full Code Here

        Article example = createArticle();
        database.makePersistent(example);
        tx.commit();

        // 1. perform binding
        tx.begin();
        try
        {
            database.bind(example, name);
            tx.commit();
        }
View Full Code Here

            fail(ex.getMessage());
        }

        // 2. perform unbind
        tx = odmg.newTransaction();
        tx.begin();
        try
        {
            database.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) database.lookup(name);
            assertNotNull("Should not find unbind name '" + name+"'", value);
            fail("name " + name + " should not be known after unbind");
View Full Code Here

    protected void setUp() throws Exception
    {
        super.setUp();
        Transaction tx = odmg.newTransaction();
        tx.begin();
        productGroup = new ProductGroup();
        productGroup.setName("DMapTest_" + System.currentTimeMillis() + "_");
        database.makePersistent(productGroup);
        tx.commit();
    }
View Full Code Here

        // create a unique name:
        final String name = "testReadAndStore_" + System.currentTimeMillis();

        // create test objects
        Transaction tx = odmg.newTransaction();
        tx.begin();
        // add objects to list
        for (int i = 0; i < 5; i++)
        {
            tx.lock(createObject(name), Transaction.WRITE);
        }
View Full Code Here

        {
            tx.lock(createObject(name), Transaction.WRITE);
        }
        tx.commit();

        tx.begin();
        // query test objects
        OQLQuery q = odmg.newOQLQuery();
        q.create("select all from "+DObject.class.getName()+" where name=$1");
        q.bind(name);
        Collection ret = (Collection) q.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.