Package org.apache.commons.transaction.util

Examples of org.apache.commons.transaction.util.RendezvousBarrier.meet()


        txMap1.startTransaction();
        thread1.start();

        report("value1", (String) txMap1.get("key1"));
        beforeCommitBarrier.call();
        afterCommitBarrier.meet();
        // we have read committed as isolation level, that's why I will see the new value of the other thread now
        report("value2", (String) txMap1.get("key1"));

        // now when I override it it should of course be my value again
        txMap1.put("key1", "value3");
View Full Code Here


                txMap1.suspendTransaction();
                afterSuspendBarrier.call();
            }
        }).start();

        afterSuspendBarrier.meet();
        txMap1.resumeTransaction(ctx);

        assertEquals(txMap1.size(), 1);
        txMap1.put("key3", "value3");
        assertEquals(txMap1.size(), 2);
View Full Code Here

        txMap1.startTransaction();
        thread1.start();

        report("value1", (String) txMap1.get("key1"));
        beforeCommitBarrier.call();
        afterCommitBarrier.meet();
        // we have serializable as isolation level, that's why I will still see the old value
        report("value1", (String) txMap1.get("key1"));

        // now when I override it it should of course be my value
        txMap1.put("key1", "value3");
View Full Code Here

    txMap1.startTransaction();
    thread1.start();

    report("value1", (String) txMap1.get("key1"));
    beforeCommitBarrier.call();
    afterCommitBarrier.meet();
    // we have serializable as isolation level, that's why I will still see the old value
    report("value1", (String) txMap1.get("key1"));

    // now when I override it it should of course be my value
    txMap1.put("key1", "value3");
View Full Code Here

                txMap1.suspendTransaction();
                afterSuspendBarrier.call();
            }
        }).start();

        afterSuspendBarrier.meet();
        txMap1.resumeTransaction(ctx);

        assertEquals(txMap1.size(), 1);
        txMap1.put("key3", "value3");
        assertEquals(txMap1.size(), 2);
View Full Code Here

                public void run() {
                    try {
                        // first both threads get a lock, this one on res2
                        manager.writeLock(owner2, res2);
                        synchronized (deadlockBarrier1) {
                            deadlockBarrier1.meet();
                            deadlockBarrier1.reset();
                        }
                        // if I am first, the other thread will be dead, i.e.
                        // exactly one
                        manager.writeLock(owner2, res1);
View Full Code Here

            try {
                // first both threads get a lock, this one on res2
                manager.readLock(owner1, res1);
                synchronized (deadlockBarrier1) {
                    deadlockBarrier1.meet();
                    deadlockBarrier1.reset();
                }
                //          if I am first, the other thread will be dead, i.e. exactly
                // one
                manager.readLock(owner1, res2);
View Full Code Here

                    } finally {
                        manager.releaseAll(jamowner1);
                        synchronized (restart) {
                            try {
                                synchronized (restart) {
                                    restart.meet();
                                    restart.reset();
                                }
                                } catch (InterruptedException ie) {}
                        }
                    }
View Full Code Here

                    } finally {
                        manager.releaseAll(jamowner2);
                        synchronized (restart) {
                            try {
                                synchronized (restart) {
                                    restart.meet();
                                    restart.reset();
                                }
                                } catch (InterruptedException ie) {}
                        }
                    }
View Full Code Here

                    } finally {
                        manager.releaseAll(owner2);
                        synchronized (restart) {
                            try {
                                synchronized (restart) {
                                    restart.meet();
                                    restart.reset();
                                }
                                } catch (InterruptedException ie) {}
                        }
                    }
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.