Package org.odmg

Examples of org.odmg.Transaction.lock()


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


            OQLQuery query = odmg.newOQLQuery();
            query.create(strQuery);
            result = (List) query.execute();
            before = result.size();

            tx.lock(child, Transaction.WRITE);
            tx.commit();

            tx.begin();
            query = odmg.newOQLQuery();
            query.create(strQuery);
View Full Code Here

        /*
         * lock only the father, let OJB do the rest
         */
        Transaction tx = odmg.newTransaction();
        tx.begin();
        tx.lock(father, Transaction.WRITE);
        tx.commit();

        // without running tx, should not take effect
        father.setChildren(null);
        father.setFirstname(null);
View Full Code Here

        /*
         lock father then all childs
         */
        Transaction tx = odmg.newTransaction();
        tx.begin();
        tx.lock(father, Transaction.WRITE);
        tx.lock(child_2, Transaction.WRITE);
        tx.lock(child_1, Transaction.WRITE);
        tx.commit();

        // without running tx, should not take effect
View Full Code Here

         lock father then all childs
         */
        Transaction tx = odmg.newTransaction();
        tx.begin();
        tx.lock(father, Transaction.WRITE);
        tx.lock(child_2, Transaction.WRITE);
        tx.lock(child_1, Transaction.WRITE);
        tx.commit();

        // without running tx, should not take effect
        father.setChildren(null);
View Full Code Here

         */
        Transaction tx = odmg.newTransaction();
        tx.begin();
        tx.lock(father, Transaction.WRITE);
        tx.lock(child_2, Transaction.WRITE);
        tx.lock(child_1, Transaction.WRITE);
        tx.commit();

        // without running tx, should not take effect
        father.setChildren(null);
        father.setFirstname(null);
View Full Code Here

         order necessary?
         if this doesn't make sense remove the test
         */
        Transaction tx = odmg.newTransaction();
        tx.begin();
        tx.lock(child_1, Transaction.WRITE);
        tx.lock(child_2, Transaction.WRITE);
        tx.lock(father, Transaction.WRITE);
        tx.commit();

        // without running tx, should not take effect
View Full Code Here

         if this doesn't make sense remove the test
         */
        Transaction tx = odmg.newTransaction();
        tx.begin();
        tx.lock(child_1, Transaction.WRITE);
        tx.lock(child_2, Transaction.WRITE);
        tx.lock(father, Transaction.WRITE);
        tx.commit();

        // without running tx, should not take effect
        father.setChildren(null);
View Full Code Here

         */
        Transaction tx = odmg.newTransaction();
        tx.begin();
        tx.lock(child_1, Transaction.WRITE);
        tx.lock(child_2, Transaction.WRITE);
        tx.lock(father, Transaction.WRITE);
        tx.commit();

        // without running tx, should not take effect
        father.setChildren(null);
        father.setFirstname(null);
View Full Code Here

        Transaction tx = odmg.newTransaction();
        tx.begin();
        ro = new RollbackObjectOne();
        ro.setName("test_step_1");
        tx.lock(ro, Transaction.WRITE);
        tx.lock(ro, Transaction.WRITE);
        tx.commit();

        tx.begin();
        tx.lock(ro, Transaction.WRITE);
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.