Examples of releaseLock()


Examples of org.apache.ojb.odmg.locking.LockManager.releaseLock()

        assertFalse(lm.checkWrite(tx2, a2));
        assertTrue(lm.checkWrite(tx1, a1));
        assertTrue(lm.checkWrite(tx1, a2));
        //assertFalse("2nd release should not succeed", lm.releaseLock(tx2, a2));
        //assertFalse("2nd release should not succeed", lm.releaseLock(tx2, a1));
        assertTrue("release should succeed", lm.releaseLock(tx1, a2));
        assertTrue("2nd object lock should succeed", lm.writeLock(tx2, a2));
        assertTrue("release 2nd object lock should succeed", lm.releaseLock(tx2, a2));

        try
        {
View Full Code Here

Examples of org.apache.ojb.odmg.locking.LockManager.releaseLock()

        assertTrue(lm.checkWrite(tx1, a2));
        //assertFalse("2nd release should not succeed", lm.releaseLock(tx2, a2));
        //assertFalse("2nd release should not succeed", lm.releaseLock(tx2, a1));
        assertTrue("release should succeed", lm.releaseLock(tx1, a2));
        assertTrue("2nd object lock should succeed", lm.writeLock(tx2, a2));
        assertTrue("release 2nd object lock should succeed", lm.releaseLock(tx2, a2));

        try
        {
            tx1.abort();
            tx2.abort();
View Full Code Here

Examples of org.apache.ojb.odmg.locking.LockManager.releaseLock()

            register(obj, lockMode);
        }
        catch (Throwable t)
        {
            log.error("Locking obj " + obj + " with lock mode " + lockMode + " failed", t);
            lm.releaseLock(this, obj);
            throw new LockNotGrantedException(t.getMessage());
        }
    }

    /**
 
View Full Code Here

Examples of org.apache.ojb.odmg.locking.LockManager.releaseLock()

        tx2.begin();
        LockManager lm = LockManagerFactory.getLockManager();
        boolean success1 = lm.writeLock(tx1, a);
        boolean success2 = lm.writeLock(tx2, a);

        boolean success3 = lm.releaseLock(tx1, a);

        assertTrue("1st lock should succeed", success1);
        assertTrue("2nd lock should not succeed", !success2);
        assertTrue("release should succeed", success3);
View Full Code Here

Examples of org.apache.ojb.odmg.locking.LockManager.releaseLock()

        assertFalse(tx1.getGUID().equals(tx2.getGUID()));

        assertTrue("1st lock should succeed", lm.writeLock(tx1, a1));
        assertFalse("2nd lock should not succeed", lm.writeLock(tx2, a2));
        lm.releaseLock(tx2, a2);
        lm.releaseLock(tx2, a1);
        assertFalse(lm.checkWrite(tx2, a1));
        assertFalse(lm.checkWrite(tx2, a2));
        assertTrue(lm.checkWrite(tx1, a1));
        assertTrue(lm.checkWrite(tx1, a2));
View Full Code Here

Examples of org.apache.ojb.odmg.locking.LockManager.releaseLock()

        assertFalse(tx1.getGUID().equals(tx2.getGUID()));

        assertTrue("1st lock should succeed", lm.writeLock(tx1, a1));
        assertFalse("2nd lock should not succeed", lm.writeLock(tx2, a2));
        lm.releaseLock(tx2, a2);
        lm.releaseLock(tx2, a1);
        assertFalse(lm.checkWrite(tx2, a1));
        assertFalse(lm.checkWrite(tx2, a2));
        assertTrue(lm.checkWrite(tx1, a1));
        assertTrue(lm.checkWrite(tx1, a2));
        //assertFalse("2nd release should not succeed", lm.releaseLock(tx2, a2));
View Full Code Here

Examples of org.apache.ojb.otm.lock.LockManager.releaseLock()

        LockManager lockManager = LockManager.getInstance();

        for (Iterator it = _objects.keySet().iterator(); it.hasNext(); )
        {
            Identity oid = (Identity) it.next();
            lockManager.releaseLock(oid, _tx);
        }
        _tx.getKit().getLockMap().gc();
    }

    /**
 
View Full Code Here

Examples of org.apache.ojb.otm.lock.LockManager.releaseLock()

        LockManager lockManager = LockManager.getInstance();

        for (Iterator it = _objects.keySet().iterator(); it.hasNext(); )
        {
            Identity oid = (Identity) it.next();
            lockManager.releaseLock(oid, _tx);
        }
        _tx.getKit().getLockMap().gc();
    }

    /**
 
View Full Code Here

Examples of org.apache.roller.business.runnable.ThreadManager.releaseLock()

           
            if(lockAcquired) {
               
                log.debug("Attempting to release lock");
               
                boolean lockReleased = mgr.releaseLock(this);
               
                if(lockReleased) {
                    log.debug("Lock released, time to sleep");
                } else {
                    log.debug("Lock NOT released, some kind of problem");
View Full Code Here

Examples of org.exolab.castor.persist.LockEngine.releaseLock()

        if (accessMode == AccessMode.ReadOnly) {
            // Mark it read-only.
            _tracker.markReadOnly(objectInTx);

            // Release the lock on this object.
            engine.releaseLock(this, oid);

        }
        return objectInTx;
    }
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.