Package org.apache.ojb.otm.core

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


            tx.begin();
            pg = (ProductGroup) _conn.getObjectByIdentity(pgOid);
            pg.setName("2");
            _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());
View Full Code Here


                tx.commit();
            }
            catch (Throwable ex)
            {
                ex.printStackTrace();
                tx.rollback();
            }
        }
        catch (Throwable ex)
        {
            try
View Full Code Here

        {
            try
            {
                if (tx != null && tx.isInProgress())
                {
                    tx.rollback();
                }
            }
            catch (Exception ex2)
            {
            }
View Full Code Here

        {
            try
            {
                if (tx != null && tx.isInProgress())
                {
                    tx.rollback();
                }
            }
            catch (Exception ex2)
            {
            }
View Full Code Here

                tx.commit();
            }
            catch (Throwable ex)
            {
                ex.printStackTrace();
                tx.rollback();
            }
        }
    }

    public void testSwizzling() throws Throwable
View Full Code Here

        {
            if (tx != null)
            {
                try
                {
                    tx.rollback();
                }
                catch (Throwable ex)
                {
                    ex.printStackTrace();
                }
View Full Code Here

        try {
            conn2.getObjectByIdentity(oid, LockType.WRITE_LOCK);
            fail("LockingException was not thrown");
        } catch (LockingException ex) {
            // ok: we cannot write lock from another tx
            tx2.rollback();
        }
    }

    public static void main(String[] args)
    {
View Full Code Here

            assertEquals("Cache was damaged.", "oldStreet", address.getStreet());
            tx.commit();
        } catch (Throwable e) {
            if (tx != null) {
                try {
                    tx.rollback();
                } catch (Throwable ex) {
                    ex.printStackTrace();
                }
            }
            throw e;
View Full Code Here

            addresses = _conn.getCollectionByQuery(q);
            tx.commit();
        } catch (Throwable e) {
            if (tx != null) {
                try {
                    tx.rollback();
                } catch (Throwable ex) {
                    ex.printStackTrace();
                }
            }
            throw e;
View Full Code Here

            }
            tx.commit();
        } catch (Throwable e) {
            if (tx != null) {
                try {
                    tx.rollback();
                } catch (Throwable ex) {
                    ex.printStackTrace();
                }
            }
            throw e;
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.