Package org.apache.ojb.otm.core

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


            }
            else
            {
                fail("Query returned empty result set");
            }
            tx.commit();

            // get from the database via OQLQuery Iterator
            tx = _kit.getTransaction(_conn);
            _conn.invalidate(oid);
            tx.begin();
View Full Code Here


            }
            else
            {
                fail("Query returned empty result set");
            }
            tx.commit();

            // get from the database via OQLQuery Collection
            tx = _kit.getTransaction(_conn);
            _conn.invalidate(oid);
            tx.begin();
View Full Code Here

            }
            else
            {
                fail("Query returned empty result set");
            }
            tx.commit();

            // get from the database
            tx = _kit.getTransaction(_conn);
            tx.begin();
            _conn.invalidate(oid);
View Full Code Here

            tx = _kit.getTransaction(_conn);
            tx.begin();
            _conn.invalidate(oid);
            example = (Article) _conn.getObjectByIdentity(oid);
            assertEquals("should be equal", "337", example.getArticleName());
            tx.commit();

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

            {
                tx = _kit.getTransaction(_conn);
                tx.begin();
                example = (Article) _conn.getObjectByIdentity(oid);
                _conn.deletePersistent(example);
                tx.commit();
            }
            catch (Throwable ex)
            {
                ex.printStackTrace();
                tx.rollback();
View Full Code Here

            ProductGroupWithCollectionProxy pg = new ProductGroupWithCollectionProxy();
            pg.setId(77777);
            pg.setName("1");
            _conn.makePersistent(pg);

            tx.commit();

            Identity oid = _conn.getIdentity(pg);

            // get from the database
            tx = _kit.getTransaction(_conn);
View Full Code Here

            article.setProductGroup(pg);
            article.setStock(333);
            article.setArticleName("333");
            pg.getAllArticlesInGroup().add(article);
            _conn.makePersistent(article);
            tx.commit();

            // get from the database
            tx = _kit.getTransaction(_conn);
            tx.begin();
            _conn.invalidate(oid);
View Full Code Here

            tx.begin();
            _conn.invalidate(oid);
            pg = (ProductGroupWithCollectionProxy) _conn.getObjectByIdentity(oid);
            assertEquals("CollectionProxy size", 1, pg.getAllArticlesInGroup().size());
            ((InterfaceArticle) pg.getAllArticlesInGroup().get(0)).setArticleName("444");
            tx.commit();

            // test isolation of the cache
            ((InterfaceArticle) pg.getAllArticlesInGroup().get(0)).setArticleName("555");

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

            tx = _kit.getTransaction(_conn);
            tx.begin();
            pg = (ProductGroupWithCollectionProxy) _conn.getObjectByIdentity(oid);
            assertEquals("Article name", "444",
                    ((InterfaceArticle) pg.getAllArticlesInGroup().get(0)).getArticleName());
            tx.commit();

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

                tx = _kit.getTransaction(_conn);
                tx.begin();
                pg = (ProductGroupWithCollectionProxy) _conn.getObjectByIdentity(oid);
                _conn.deletePersistent(pg.getAllArticlesInGroup().get(0));
                _conn.deletePersistent(pg);
                tx.commit();
            }
            catch (Throwable ex)
            {
                ex.printStackTrace();
                tx.rollback();
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.