Package org.apache.ojb.broker

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


            if (result != null)
            {
                broker.beginTransaction();
                broker.delete(result);
                broker.commitTransaction();
                isDeleted = true;
            }
        }
        catch (PersistenceBrokerException ex)
        {
View Full Code Here


        {
            broker = PersistenceBrokerFactory.defaultPersistenceBroker();

            broker.beginTransaction();
            broker.delete(product);
            broker.commitTransaction();
        }
        catch (PersistenceBrokerException ex)
        {
            if (broker != null)
            {
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

            obj.setName("testLoadingProfiles");
            try
            {
                broker.beginTransaction();
                broker.store(obj);
                broker.commitTransaction();
                try
                {
                    // try to find persistent object, only available in global
                    // repository profile
                    Class clazz = broker.getClassDescriptor(TEST_CLASS).getClassOfObject();
View Full Code Here

            compParent.setName("MetadataTest_parent");
            compChild.setParentComponent(compParent);

            broker.beginTransaction();
            broker.store(compChild);
            broker.commitTransaction();

            Identity oid = new Identity(compChild, broker);
            broker.clearCache();
            compChild = (ObjectRepository.Component) broker.getObjectByIdentity(oid);
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

            // 2. start broker transaction
            broker.beginTransaction();
            // 3. now ask broker to store the edited object
            broker.store(product);
            // 4. commit transaction
            broker.commitTransaction();
        }
        catch (OJBRuntimeException ex)
        {
            // rollback in case of errors
            if (broker != null)
View Full Code Here

            // 4. start broker transaction
            broker.beginTransaction();
            // 5. delete product
            broker.deleteByQuery(query);
            // 6. commit transaction
            broker.commitTransaction();
        }
        catch (OJBRuntimeException ex)
        {
            // rollback in case of errors
            if (broker != null)
View Full Code Here

    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

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.