Package org.apache.ojb.odmg

Examples of org.apache.ojb.odmg.TransactionExt.lock()


        /* One possibility of storing objects is to use the current transaction
         associated with the container */
        try
        {
            TransactionExt tx = (TransactionExt) odmg.currentTransaction();
            tx.lock(object, Transaction.WRITE);
            tx.markDirty(object);
        }
        catch (LockNotGrantedException e)
        {
            log.error("Failure while storing object " + object, e);
View Full Code Here


        /* One possibility of storing objects is to use the current transaction
         associated with the container */
        try
        {
            TransactionExt tx = (TransactionExt) odmg.currentTransaction();
            tx.lock(object, Transaction.WRITE);
            tx.markDirty(object);
        }
        catch (LockNotGrantedException e)
        {
            log.error("Failure while storing object " + object, e);
View Full Code Here

        tx.commit();

        // add new reference to object
        CollectionReference ref_6 = new CollectionReference(null, "###_new_" + nameRef);
        tx.begin();
        tx.lock(obj_2, Transaction.WRITE);
        obj_2.addReference(ref_6);
        tx.commit();

        references = obj_2.getAllReferences();
        assertNotNull(references);
View Full Code Here

        assertEquals(id_2, obj_2.getIdentifier());

        // now update main objects
        tx.begin();
        tx.lock(obj_2, Transaction.WRITE);
        obj_2.setName(name+"_update");
        tx.commit();

        broker = PersistenceBrokerFactory.defaultPersistenceBroker();
        obj_2 = (MainObject) broker.getObjectByIdentity(oid_2);
View Full Code Here

        broker.close();

        // now update reference
        assertNotNull(obj_2);
        tx.begin();
        tx.lock(obj_2, Transaction.WRITE);
        references = obj_2.getAllReferences();
        CollectionReference ref = (CollectionReference) references.get(0);
        tx.lock(ref, Transaction.WRITE);
        ref.setRefName(nameRef+"_update");
        tx.commit();
View Full Code Here

        assertNotNull(obj_2);
        tx.begin();
        tx.lock(obj_2, Transaction.WRITE);
        references = obj_2.getAllReferences();
        CollectionReference ref = (CollectionReference) references.get(0);
        tx.lock(ref, Transaction.WRITE);
        ref.setRefName(nameRef+"_update");
        tx.commit();

        broker = PersistenceBrokerFactory.defaultPersistenceBroker();
        obj_2 = (MainObject) broker.getObjectByIdentity(oid_2);
View Full Code Here

        /* One possibility of storing objects is to use the current transaction
         associated with the container */
        try
        {
            TransactionExt tx = (TransactionExt) odmg.currentTransaction();
            tx.lock(object, Transaction.WRITE);
            tx.markDirty(object);
        }
        catch (LockNotGrantedException e)
        {
            log.error("Failure while storing object " + object, e);
View Full Code Here

        /* One possibility of storing objects is to use the current transaction
         associated with the container */
        try
        {
            TransactionExt tx = (TransactionExt) odmg.currentTransaction();
            tx.lock(object, Transaction.WRITE);
            tx.markDirty(object);
        }
        catch (LockNotGrantedException e)
        {
            log.error("Failure while storing object " + object, e);
View Full Code Here

        tx.commit();

        // add new reference to object
        CollectionReference ref_6 = new CollectionReference(null, "###_new_" + nameRef);
        tx.begin();
        tx.lock(obj_2, Transaction.WRITE);
        obj_2.addReference(ref_6);
        tx.commit();

        references = obj_2.getAllReferences();
        assertNotNull(references);
View Full Code Here

        assertEquals(id_2, obj_2.getIdentifier());

        // now update main objects
        tx.begin();
        tx.lock(obj_2, Transaction.WRITE);
        obj_2.setName(name+"_update");
        tx.commit();

        broker = PersistenceBrokerFactory.defaultPersistenceBroker();
        obj_2 = (MainObject) broker.getObjectByIdentity(oid_2);
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.