Package com.sun.sgs.service

Examples of com.sun.sgs.service.TransactionProxy


        txnScheduler.runTask(runner, taskOwner);
        assertEquals(0, runner.getRunCount());
    }

    @Test public void runTaskTransactional() throws Exception {
        final TransactionProxy proxy = serverNode.getProxy();
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
                public void run() throws Exception {
                    proxy.getCurrentTransaction();
                    proxy.getCurrentOwner();
                }
            }, taskOwner);
    }
View Full Code Here


                }
            }, taskOwner);
    }

    @Test public void runTransactionInTransaction() throws Exception {
        final TransactionProxy proxy = serverNode.getProxy();
        KernelRunnable task = new TestAbstractKernelRunnable() {
                public void run() throws Exception {
                    final Transaction t = proxy.getCurrentTransaction();
                    txnScheduler.runTask(new TestAbstractKernelRunnable() {
                            public void run() throws Exception {
                                Transaction t2 = proxy.getCurrentTransaction();
                                assertTrue(t.equals(t2));
                            }
                        }, taskOwner);
                }
            };
View Full Code Here

            }, taskOwner);
    }

    @Test (expected=RuntimeException.class)
        public void runNonRetriedTaskExplicitAbort() throws Exception {
        final TransactionProxy proxy = serverNode.getProxy();
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
                public void run() throws Exception {
                    RuntimeException re = new RuntimeException("intentional");
                    proxy.getCurrentTransaction().abort(re);
                    throw re;
                }
            }, taskOwner);
    }
View Full Code Here

TOP

Related Classes of com.sun.sgs.service.TransactionProxy

Copyright © 2018 www.massapicom. 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.