Package org.apache.ojb.broker

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


        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

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

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

                broker = PersistenceBrokerFactory.defaultPersistenceBroker();
                broker.serviceConnectionManager().setBatchMode(true);
                broker.beginTransaction();
                for (int i = 0; i < arr.length; i++)
                {
                    broker.store(arr[i], ObjectModification.INSERT);
                }
                broker.commitTransaction();
            }
            finally
            {
View Full Code Here

                broker = PersistenceBrokerFactory.defaultPersistenceBroker();
                broker.serviceConnectionManager().setBatchMode(true);
                broker.beginTransaction();
                for (int i = 0; i < arr.length; i++)
                {
                    broker.store(arr[i], ObjectModification.UPDATE);
                    // broker.store(arr[i]);
                }
                broker.commitTransaction();
            }
            finally
View Full Code Here

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

        String name = "my test key " + System.currentTimeMillis();
        Repository.SMKey key = new Repository.SMKey();
        key.setName(name);
        PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker();
        broker.beginTransaction();
        broker.store(key);
        broker.commitTransaction();
        assertEquals("Value was not store: " + key, name, key.getName());
        assertNotNull(MESSAGE + key, key.getIntegerKey());
        assertTrue(MESSAGE + key, (key.getIntKey() != 0));
        assertNotNull(MESSAGE + key, key.getLongKey());
View Full Code Here

                SMAutoNaming obj = new SMAutoNaming("testAutoNaming_1");
                sd = broker.serviceConnectionManager().getConnectionDescriptor().getSequenceDescriptor();
                assertTrue("false".equals(sd.getAttribute("autoNaming")));

                broker.beginTransaction();
                broker.store(obj);
                broker.commitTransaction();
                fail("If sequence manager implementation supports 'autoNaming' feature,"
                        +" this test should cause an exception (else ignore this failure).");
            }
            catch (PersistenceBrokerException e)
View Full Code Here

                --> should pass
                */
                field.setSequenceName("AA_testAutoNaming_user_set");
                SMAutoNaming obj = new SMAutoNaming("testAutoNaming_2");
                broker.beginTransaction();
                broker.store(obj);
                broker.commitTransaction();
            }
            catch (PersistenceBrokerException e)
            {
                e.printStackTrace();
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.