Package org.apache.ojb.broker

Examples of org.apache.ojb.broker.PersistenceBroker.commitTransaction()


    assertNull(id.getObjectsRealClass());
    Object group0 = pb0.getObjectByIdentity(id);
    assertNotNull(group0);
    assertEquals(CloneableGroup.class, id.getObjectsRealClass());
    assertStmtCount("access one group", 1);
    pb0.commitTransaction();

    resetStmtCount();
    pb1.beginTransaction();
    Object group1 = pb1.getObjectByIdentity(id);
    assertStmtCount("access one group again", 0); // lookup again, 2nd level hit, no SQL access.
View Full Code Here


        try
        {
            broker.beginTransaction();
            broker.store(obj);
            broker.store(dummy);
            broker.commitTransaction();

            Identity obj_oid = new Identity(obj, broker);
            Identity dummy_oid = new Identity(dummy, broker);
            ObjectCache cache = broker.serviceObjectCache();
            Object ret_obj = cache.lookup(obj_oid);
View Full Code Here


        broker1.commitTransaction();
        broker1.close();

        broker2.commitTransaction();
        broker2.close();
    }


View Full Code Here

        PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker();
        try
        {
            broker.beginTransaction();
            broker.store(obj);
            broker.commitTransaction();

            Identity oid = new Identity(obj, broker);
            obj = (TestObjectDefaultCache) broker.serviceObjectCache().lookup(oid);
            assertNotNull(obj);
View Full Code Here

        PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker();
        try
        {
            broker.beginTransaction();
            broker.store(obj);
            broker.commitTransaction();

            Identity oid = new Identity(obj, broker);
            obj = (TestObjectDefaultCache) broker.serviceObjectCache().lookup(oid);
            assertNotNull(obj);
            assertEquals(name, obj.getName());
View Full Code Here

        }
        finally
        {
            if(targetBroker != null && needsCommit)
            {
                targetBroker.commitTransaction();
            }
        }
        return result;
    }
View Full Code Here

            internBroker = PersistenceBrokerFactory.createPersistenceBroker(brokerForSequence.getPBKey());
            internBroker.beginTransaction();

            newSequence = lookupStoreSequence(internBroker, field, sequenceName);

            internBroker.commitTransaction();

            if (log.isDebugEnabled()) log.debug("new sequence was " + newSequence);
        }
        catch(Exception e)
        {
View Full Code Here

                try
                {
                    broker = PersistenceBrokerFactory.defaultPersistenceBroker();
                    broker.beginTransaction();
                    broker.store(arr[i]);
                    broker.commitTransaction();
                }
                finally
                {
                    if (broker != null) broker.close();
                }
View Full Code Here

                broker.beginTransaction();
                for (int i = 0; i < arr.length; i++)
                {
                    broker.store(arr[i], ObjectModification.INSERT);
                }
                broker.commitTransaction();
            }
            finally
            {
                if (broker != null) broker.close();
            }
View Full Code Here

                for (int i = 0; i < arr.length; i++)
                {
                    broker.store(arr[i], ObjectModification.UPDATE);
                    // broker.store(arr[i]);
                }
                broker.commitTransaction();
            }
            finally
            {
                if (broker != null) broker.close();
            }
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.