Package org.apache.ojb.otm.core

Examples of org.apache.ojb.otm.core.Transaction.begin()


        //perform transaction
        try
        {
            tx = _kit.getTransaction(_conn);
            tx.begin();

            ProductGroup pg = new ProductGroup();
            pg.setId(77777);
            pg.setName("1");
            _conn.makePersistent(pg);
View Full Code Here


            Identity aOid = _conn.getIdentity(article);
            Identity pgOid = _conn.getIdentity(pg);

            tx = _kit.getTransaction(_conn);
            tx.begin();
            pg = (ProductGroup) _conn.getObjectByIdentity(pgOid);
            pg.setName("2");
            _conn.makePersistent(pg);
            tx.rollback();
View Full Code Here

            pg.setName("2");
            _conn.makePersistent(pg);
            tx.rollback();

            tx = _kit.getTransaction(_conn);
            tx.begin();
            article = (Article) _conn.getObjectByIdentity(aOid);
            assertEquals("should be equal", "1", article.getProductGroup().getName());
            tx.commit();

            // test checkpoint
View Full Code Here

            assertEquals("should be equal", "1", article.getProductGroup().getName());
            tx.commit();

            // test checkpoint
            tx = _kit.getTransaction(_conn);
            tx.begin();
            pg = (ProductGroup) _conn.getObjectByIdentity(pgOid);
            pg.setName("2");
            _conn.makePersistent(pg);
            tx.checkpoint();
            tx.rollback();
View Full Code Here

            _conn.makePersistent(pg);
            tx.checkpoint();
            tx.rollback();

            tx = _kit.getTransaction(_conn);
            tx.begin();
            article = (Article) _conn.getObjectByIdentity(aOid);
            assertEquals("should be equal", "1", article.getProductGroup().getName());
            tx.commit();

            try
View Full Code Here

            tx.commit();

            try
            {
                tx = _kit.getTransaction(_conn);
                tx.begin();
                article = (Article) _conn.getObjectByIdentity(aOid);
                _conn.deletePersistent(article);
                _conn.deletePersistent(article.getProductGroup());
                tx.commit();
            }
View Full Code Here

            tx.begin();
            pg = (ProductGroup) _conn.getObjectByIdentity(pgOid);
            pg.setName("2");

            tx2 = _kit.getTransaction(conn2);
            tx2.begin();
            pg = (ProductGroup) conn2.getObjectByIdentity(pgOid);
            assertEquals("should be equal", "1", pg.getName());
            tx2.commit();
            tx.commit();
View Full Code Here

            final Identity pgOid = _conn.getIdentity(pg);
            final Identity pgOid2 = _conn.getIdentity(pg2);


            final Transaction tx3 = _kit.getTransaction(_conn);
            tx3.begin();
            _conn.getObjectByIdentity(pgOid, LockType.WRITE_LOCK);
            // we can write lock twice from the same tx
            _conn.getObjectByIdentity(pgOid, LockType.WRITE_LOCK);

            // test different LockWaitStrategies
View Full Code Here

        //perform transaction
        try
        {
            tx = _kit.getTransaction(_conn);
            tx.begin();

            pg = new ProductGroup();
            pg.setId(77777);
            pgOid = _conn.getIdentity(pg);
            pg.setName("1");
View Full Code Here

            _conn.makePersistent(project);
            tx.commit();


            tx = _kit.getTransaction(_conn);
            tx.begin();
            pg = (ProductGroup) _conn.getObjectByIdentity(pgOid);
            article2 = (Article) pg.getAllArticles().get(0);
            article = (Article) pg.getAllArticles().get(1);
            if (!_conn.getIdentity(article2).equals(aOid2))
            {
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.