Package org.apache.ojb.otm.core

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


            while (oldAddressesIterator.hasNext()) {
                Address oldAddress = (Address)oldAddressesIterator.next();
                _conn.deletePersistent(oldAddress);
                oldAddressesIterator.remove();
            }
            tx.commit();
        } catch (Throwable e) {
            if (tx != null) {
                try {
                    tx.rollback();
                } catch (Throwable ex) {
View Full Code Here


        pg = (ProductGroup) _conn.getObjectByIdentity(oidPG);
        if (pg != null)
        {
            _conn.deletePersistent(pg);
        }
        tx.commit();
    }

    private TestClassA generateTestData()
    {
        TestClassA tca = new TestClassA();
View Full Code Here

        while (it.hasNext())
        {
            retval = it.next();
            ((Contract) retval).setRelatedToContract(r2c);
        }
        tx.commit();
        r2c = null;
        tx = _kit.getTransaction(_conn);
        tx.begin();
        crit = new Criteria();
        crit.addEqualTo("pk", "E" + TIME);
View Full Code Here

        retval = null;
        while (it.hasNext())
        {
            retval = it.next();
        }
        tx.commit();
        assertTrue("contract object should have a RelatedToContract instance attached", ((Effectiveness) retval).getVersion().getContract().getRelatedToContract() != null);
    }

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

        Transaction tx = _kit.getTransaction(_conn);
        tx.begin();
        _conn.makePersistent(a.getB());
        _conn.makePersistent(a);
    TestClassB b = a.getB();
        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.getB().equals(b1));
        tx.commit();

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

            contract.setContractValue1("contractvalue1");
            contract.setContractValue2(1);
            contract.setContractValue3("contractvalue3");
            contract.setContractValue4(new Timestamp(TIME));
            _conn.makePersistent(contract);
            tx.commit();
            tx = _kit.getTransaction(_conn);
            tx.begin();
            Version version = new Version();
            version.setPk("V" + TIME);
            version.setVersionValue1("versionvalue1");
View Full Code Here

            version.setVersionValue1("versionvalue1");
            version.setVersionValue2(1);
            version.setVersionValue3(new Timestamp(TIME));
            version.setContract(contract);
            _conn.makePersistent(version);
            tx.commit();
            tx = _kit.getTransaction(_conn);
            tx.begin();
            Effectiveness eff = new Effectiveness();
            eff.setPk("E" + TIME);
            eff.setEffValue1("effvalue1");
View Full Code Here

            eff.setEffValue1("effvalue1");
            eff.setEffValue2(1);
            eff.setEffValue3(new Timestamp(TIME));
            eff.setVersion(version);
            _conn.makePersistent(eff);
            tx.commit();
        }
    }

    public void deleteAllData() throws LockingException
    {
View Full Code Here

        iter = _conn.getIteratorByQuery(q);
        while (iter.hasNext())
        {
            _conn.deletePersistent(iter.next());
        }
        tx.commit();
        /**
        * then version
        */
        tx = _kit.getTransaction(_conn);
        tx.begin();
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.