Package org.apache.ojb.otm.core

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


      return m_baoa;
    }
    else
    {
      Transaction tx = _kit.getTransaction(_conn);
      tx.begin();
      BidirectionalAssociationObjectA a = new BidirectionalAssociationObjectA();
      a.setPk("abc123");
      Identity oid = _conn.getIdentity(a);
      a = (BidirectionalAssociationObjectA) _conn.getObjectByIdentity(oid);
      if (a == null)
View Full Code Here


      return m_zoo;
    }
    else
    {
      Transaction tx = _kit.getTransaction(_conn);
      tx.begin();
      Zoo zoo = new Zoo();
      zoo.setZooId(1234);
      Identity oid = _conn.getIdentity(zoo);
      zoo = (Zoo) _conn.getObjectByIdentity(oid);
      if (zoo == null)
View Full Code Here

      return m_tca;
    }
    else
    {
      Transaction tx = _kit.getTransaction(_conn);
      tx.begin();
      TestClassA tca = new TestClassA();
      tca.setOid("someoid");
      Identity oid = _conn.getIdentity(tca);
      tca = (TestClassA) _conn.getObjectByIdentity(oid);
      if (tca == null)
View Full Code Here

        OTMConnection conn1 = _kit.acquireConnection(PersistenceBrokerFactory.getDefaultKey());
        OTMConnection conn2 = _kit.acquireConnection(PersistenceBrokerFactory.getDefaultKey());
        try
        {
            tx = _kit.getTransaction(conn1);
            tx.begin();

            tx.registerConnection(conn2);

            example = (Article) conn1.getObjectByIdentity(
                    new Identity(Article.class, Article.class,
View Full Code Here

        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);
        tx.commit();

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

        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());
        tx.commit();
        clearTestData();
    }
View Full Code Here

        clearTestData();
        TestClassA a = generateTestData();
    TestClassB b = a.getB();
        Transaction tx = _kit.getTransaction(_conn);

        tx.begin();
        _conn.makePersistent(b);
        _conn.makePersistent(a);
        b.setA(a);
        tx.commit();
        /**
 
View Full Code Here

        /**
        * clear to start test
        */
        _conn.invalidateAll();
        tx = _kit.getTransaction(_conn);
        tx.begin();
        /**
     * load B
     */
    Identity oidb = _conn.getIdentity(b);
        TestClassB b1 = (TestClassB) _conn.getObjectByIdentity(oidb);
View Full Code Here

        Identity oid;
        Address address = new Address("oldCountry", "oldCity", "oldStreet");

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

            address.setStreet("newStreet");
View Full Code Here

            tx.commit();

            address.setStreet("newStreet");

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

            address.setStreet("newStreet");
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.