Package com.sun.sgs.service

Examples of com.sun.sgs.service.Transaction.abort()


                    task.setDone(null);
                    return true;
                } catch (InterruptedException ie) {
                    // make sure the transaction was aborted
                    if (!transaction.isAborted()) {
                        transaction.abort(ie);
                    }
                    profileCollectorHandle.finishTask(task.getTryCount(), ie);
                    // if the task didn't finish because of the interruption
                    // then we want to note that and possibly re-queue the
                    // task to run in a usable thread
View Full Code Here


                    // always re-throw the interruption
                    throw ie;
                } catch (Throwable t) {
                    // make sure the transaction was aborted
                    if ((transaction != null) && (!transaction.isAborted())) {
                        transaction.abort(t);
                    }
                    profileCollectorHandle.finishTask(task.getTryCount(), t);
                    // some error occurred, so see if we should re-try
                    if (!shouldRetry(task, t)) {
                        // the task is not being re-tried
View Full Code Here

            txnScheduler.runTask(new TestAbstractKernelRunnable() {
                public void run() {
                assertEquals(dummy, getBinding(app, service, "dummy"));
                setBinding(app, service, "dummy", dummy2);
                Transaction txn = txnProxy.getCurrentTransaction();
                txn.abort(new TestAbortedTransactionException("abort"));
            }}, taskOwner);
        } catch (TestAbortedTransactionException e) {
            System.err.println(e);
        }
View Full Code Here

        try {
            txnScheduler.runTask(new TestAbstractKernelRunnable() {
                public void run() {
                    removeBinding(app, service, "dummy");
                    Transaction txn = txnProxy.getCurrentTransaction();
                    txn.abort(new TestAbortedTransactionException("abort"));
            }}, taskOwner);
        } catch (TestAbortedTransactionException e) {
            System.err.println(e);
        }
View Full Code Here

                    service.removeBinding("dummy");
                    DummyManagedObject serviceResult =
                        (DummyManagedObject) service.getServiceBinding("dummy");
                    assertEquals(serviceDummy, serviceResult);
                    Transaction txn = txnProxy.getCurrentTransaction();
                    txn.abort(new TestAbortedTransactionException("abort"));
            }}, taskOwner);
        } catch (TestAbortedTransactionException e) {
            System.err.println(e);
        }
View Full Code Here

                assertEquals("zzz-2", nextBoundName(app, service, "zzz-1"));
                assertEquals("zzz-2", nextBoundName(app, service, "zzz-1"));
                assertNull(nextBoundName(app, service, "zzz-2"));
                assertNull(nextBoundName(app, service, "zzz-2"));
                Transaction txn = txnProxy.getCurrentTransaction();
                txn.abort(new TestAbortedTransactionException("abort"));
            }}, taskOwner);
        } catch (TestAbortedTransactionException e) {
            System.err.println(e);
        }
View Full Code Here

                    } else {
                        throw (Error) t;
                    }
                }
                Transaction txn = txnProxy.getCurrentTransaction();
                txn.abort(new TestAbortedTransactionException("abort"));
        }}, taskOwner);

        assertTrue(doneFlag.tryAcquire(2, 1, TimeUnit.SECONDS));
        Throwable throwable = error.get();
        if (throwable != null) {
View Full Code Here

                action2.assertBlocked();
                action1.interrupt(); // shutdown should not unblock
                action1.assertBlocked();
                action2.assertBlocked();
                Transaction txn = txnProxy.getCurrentTransaction();
                txn.abort(new TestAbortedTransactionException("abort"));
            }
        }

        try {
            TestTask task = new TestTask();
View Full Code Here

                action1 = new ShutdownServiceAction(service);
                action1.assertBlocked();
                action2 = new ShutdownServiceAction(service);
                action2.assertBlocked();
                Transaction txn = txnProxy.getCurrentTransaction();
                txn.abort(new TestAbortedTransactionException("abort"));
            }
        }

        try {
            TestTask task = new TestTask();
View Full Code Here

        // We use dummy outside of the transaction - it is transient here.
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
            public void run() {
                service.removeObject(dummy);
                Transaction txn = txnProxy.getCurrentTransaction();
                txn.abort(new TestAbortedTransactionException("abort"));
        }}, taskOwner);
    }

    @Test
    public void testCommitReadOnly() throws Exception {
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.