Package org.apache.ojb.otm.core

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


        tx = _kit.getTransaction(_conn);
        tx.begin();
        pg = (ProductGroup) _conn.getObjectByIdentity(pgOid);
        assertEquals("should be equal", 0, pg.getAllArticlesInGroup().size());
        tx.commit();

        tx = _kit.getTransaction(_conn);
        tx.begin();
        pg = (ProductGroup) _conn.getObjectByIdentity(pgOid);
        pg.getAllArticlesInGroup().add(article);
View Full Code Here


        tx = _kit.getTransaction(_conn);
        tx.begin();
        pg = (ProductGroup) _conn.getObjectByIdentity(pgOid);
        pg.getAllArticlesInGroup().add(article);
        tx.commit();

        tx = _kit.getTransaction(_conn);
        tx.begin();
        pg = (ProductGroup) _conn.getObjectByIdentity(pgOid);
        assertEquals("should be equal", 1, pg.getAllArticlesInGroup().size());
View Full Code Here

        tx = _kit.getTransaction(_conn);
        tx.begin();
        pg = (ProductGroup) _conn.getObjectByIdentity(pgOid);
        assertEquals("should be equal", 1, pg.getAllArticlesInGroup().size());
        tx.commit();
        clearTestData();
    }

   public void testSwizzle4() throws TransactionException, LockingException, PBFactoryException, PersistenceBrokerException
    {
View Full Code Here

        tx.begin();
        _conn.makePersistent(b);
        _conn.makePersistent(a);
        b.setA(a);
        tx.commit();
        /**
        * clear to start test
        */
        _conn.invalidateAll();
        tx = _kit.getTransaction(_conn);
View Full Code Here

    /**
     * B, as navigated from A, should be the same as B gotten directly.
     */
    assertTrue(a1.getValue1().equals(a.getValue1()));
        tx.commit();

    /**
     * clear
     */
        clearTestData();
View Full Code Here

        try {
            tx = _kit.getTransaction(_conn);
            tx.begin();
            _conn.makePersistent(address);
            oid = _conn.getIdentity(address);
            tx.commit();

            address.setStreet("newStreet");

            tx = _kit.getTransaction(_conn);
            tx.begin();
View Full Code Here

            tx = _kit.getTransaction(_conn);
            tx.begin();
            address = (Address) _conn.getObjectByIdentity(oid);
            assertEquals("Cache was damaged.", "oldStreet", address.getStreet());
            tx.commit();

            address.setStreet("newStreet");

            tx = _kit.getTransaction(_conn);
            tx.begin();
View Full Code Here

            tx = _kit.getTransaction(_conn);
            tx.begin();
            address = (Address) _conn.getObjectByIdentity(oid, LockType.WRITE_LOCK);
            assertEquals("Cache was damaged.", "oldStreet", address.getStreet());
            tx.commit();

            address.setStreet("newStreet");

            tx = _kit.getTransaction(_conn);
            tx.begin();
View Full Code Here

            tx = _kit.getTransaction(_conn);
            tx.begin();
            address = (Address) _conn.getObjectByIdentity(oid);
            assertEquals("Cache was damaged.", "oldStreet", address.getStreet());
            tx.commit();
        } catch (Throwable e) {
            if (tx != null) {
                try {
                    tx.rollback();
                } catch (Throwable ex) {
View Full Code Here

            tx = _kit.getTransaction(_conn);
            tx.begin();
            _conn.invalidateAll();
            Query q = QueryFactory.newQuery(Address.class, (Criteria)null);
            addresses = _conn.getCollectionByQuery(q);
            tx.commit();
        } catch (Throwable e) {
            if (tx != null) {
                try {
                    tx.rollback();
                } catch (Throwable ex) {
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.