Package org.apache.ojb.broker

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


        try
        {
            logger.debug("OjbStoreManager.insert");
            PersistenceBroker broker = connector.getBroker();
            Object instance = sm.getObject();
            broker.store(instance, ObjectModificationDefaultImpl.INSERT);
        }
        catch (Exception ex)
        {
            throw new OjbStoreFatalInternalException(getClass(), "insert", ex);
        }
View Full Code Here


        {
          logger.debug("OjbStoreManager.update");
            PersistenceBroker broker = connector.getBroker();
            fetch(sm, null);
            Object instance = sm.getObject();
            broker.store(instance, ObjectModificationDefaultImpl.UPDATE);
        }
        catch (Exception ex)
        {
            throw new OjbStoreFatalInternalException(getClass(), "update", ex);
        }
View Full Code Here

    public Object storeObject(Object object)
    {
        PersistenceBroker broker = getBroker();
        try
        {
            broker.store(object);
        }
        finally
        {
            if (broker != null) broker.close();
        }
View Full Code Here

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

            ObjectRepository.Component compParent = new ObjectRepository.Component();
            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

            // 1. get a broker
            broker = PersistenceBrokerFactory.defaultPersistenceBroker();
            // 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)
        {
View Full Code Here

        TestObjectDefaultCache obj = new TestObjectDefaultCache();
        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

        obj.setName(name);
        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

        dummy.setName(name);

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