Package org.apache.commons.transaction.util

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


                        manager.writeLock(owner4, res3);
                    } catch (LockException le) {
                        System.out.print("-");
                    } finally {
                        manager.releaseAll(owner4);
                        end.call();
                    }
                }
            }, "Thread #4");

                Thread deadlock1 = new Thread(new Runnable() {
View Full Code Here


                    } catch (LockException le) {
                        assertEquals(le.getCode(), LockException.CODE_DEADLOCK_VICTIM);
                        System.out.print("-");
                    } finally {
                        manager.releaseAll(owner5);
                        end.call();
                    }
                }
            }, "Deadlock1 Thread");

            Thread deadlock2 = new Thread(new Runnable() {
View Full Code Here

                    } catch (LockException le) {
                        assertEquals(le.getCode(), LockException.CODE_DEADLOCK_VICTIM);
                        System.out.print("-");
                    } finally {
                        manager.releaseAll(owner6);
                        end.call();
                    }
                }
            }, "Deadlock1 Thread");

            Thread reader = new Thread(new Runnable() {
View Full Code Here

                        manager.readLock("reader", res3);
                    } catch (LockException ie) {
                        System.out.print("-");
                    } finally {
                        manager.releaseAll("reader");
                        end.call();
                    }
                }
            }, "Reader Thread");

View Full Code Here

                txMap1.startTransaction();
                try {
                    beforeCommitBarrier.meet();
                    txMap1.put("key1", "value2");
                    txMap1.commitTransaction();
                    afterCommitBarrier.call();
                } catch (InterruptedException e) {
                    sLogger.logWarning("Thread interrupted", e);
                    afterCommitBarrier.reset();
                    beforeCommitBarrier.reset();
                }
View Full Code Here

        new Thread(new Runnable() {
            public void run() {
                txMap1.resumeTransaction(ctx);
                txMap1.put("key2", "value2");
                txMap1.suspendTransaction();
                afterSuspendBarrier.call();
            }
        }).start();

        afterSuspendBarrier.meet();
        txMap1.resumeTransaction(ctx);
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.