Package org.apache.ojb.otm.core

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


        tx = _kit.getTransaction(_conn);
        tx.begin();
        a = (TestClassA) _conn.getObjectByIdentity(oid);
        assertTrue(a.getB() == null);
        tx.commit();
    }

    public void testSwizzle1toN() throws Exception
    {
        clearTestData();
View Full Code Here


        article.setStock(333);
        pg.add(article);
        article.setProductGroup(pg);
        _conn.makePersistent(article);
        Identity pgOid = _conn.getIdentity(pg);
        tx.commit();

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

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

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

        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

        b.setPk("xyz987");
        _conn.makePersistent(b);
        a.setRelatedB(b);
        b.setRelatedA(a);
      }
      tx.commit();
      m_baoa = a;
      return m_baoa;
    }
  }
View Full Code Here

        reptile.setName("hubert");
        reptile.setAge(51);
        zoo.addAnimal(reptile);
        _conn.makePersistent(reptile);
      }
      tx.commit();
      m_zoo = zoo;
      return m_zoo;
    }
  }
View Full Code Here

        tcb.setOid("boid");
        tcb.setValue1("hi there");
        _conn.makePersistent(tcb);
        tca.setB(tcb);
      }
      tx.commit();
      m_tca = tca;
      return m_tca;
    }
  }
}
View Full Code Here

            query.create("select obj from " + Article.class.getName()
                         + " where " + "articleId = " + example.getArticleId());
            Article same = (Article) conn2.getIteratorByOQLQuery(query).next();
            Assert.assertNotNull("Didn't find object in context of transaction", same);

            tx.commit();

        }
        catch (Throwable ex)
        {
            try
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.