Package com.sun.sgs.app

Examples of com.sun.sgs.app.TransactionAbortedException


        "Transaction timed out: " + e.getMessage(), e);
      } else if (errorCode == XA_RBDEADLOCK) {
    throw new TransactionConflictException(
        "Transaction conflict: " + e.getMessage(), e);
      } else if (errorCode >= XA_RBBASE && errorCode <= XA_RBEND) {
    throw new TransactionAbortedException(
        "Transaction aborted: " + e.getMessage(), e);
      }
  }
  throw new DbDatabaseException(
      "Unexpected database exception: " + e, e);
View Full Code Here


        abort(e);
    }
    throw e;
      }
      if (state == State.ABORTED) {
    throw new TransactionAbortedException(
        "Transaction has been aborted: " + abortCause, abortCause);
      }
  }
  state = State.COMMITTING;
  for (TransactionParticipant participant : participants) {
View Full Code Here

      abort(e);
        }
        throw e;
    }
    if (state == State.ABORTED) {
        throw new TransactionAbortedException(
      "Transaction has been aborted: " + abortCause,
      abortCause);
    }
      }
  }
View Full Code Here

        ", objectId:" + objectId +
        descriptionMsg +
        " failed: ";
    String conflictMsg = ", with conflicting transaction " +
        conflict.getConflictingTransaction();
    TransactionAbortedException exception;
    switch (conflict.getType()) {
    case TIMEOUT:
        exception = new TransactionTimeoutException(
      accessMsg + "Transaction timed out" + conflictMsg);
        break;
View Full Code Here

        " failed: ";
    LockerImpl conflictingLocker =
        (LockerImpl) conflict.getConflictingLocker();
    String conflictMsg = ", with conflicting transaction " +
        conflictingLocker.getTransaction();
    TransactionAbortedException exception;
    switch (conflict.getType()) {
    case TIMEOUT:
        exception = new TransactionTimeoutException(
      accessMsg + "Transaction timed out" + conflictMsg);
        break;
View Full Code Here

        "Transaction timed out: " + e.getMessage(), e);
      } else if (errorCode == XA_RBDEADLOCK) {
    throw new TransactionConflictException(
        "Transaction conflict: " + e.getMessage(), e);
      } else if (errorCode >= XA_RBBASE && errorCode <= XA_RBEND) {
    throw new TransactionAbortedException(
        "Transaction aborted: " + e.getMessage(), e);
      }
  }
  throw new DbDatabaseException(
      "Unexpected database exception: " + e, e);
View Full Code Here

  assertCommitted();
    }

    @Test
    public void testCommitAbortedWithRetryableCause() throws Exception {
  Exception abortCause = new TransactionAbortedException("Aborted");
  txn.abort(abortCause);
  try {
      handle.commit();
      fail("Expected TransactionNotActiveException");
  } catch (TransactionNotActiveException e) {
View Full Code Here

    @Test
    public void testJoinAbortedWithRetryableCause() throws Exception {
  DummyTransactionParticipant participant =
      new DummyTransactionParticipant();
  Exception abortCause = new TransactionAbortedException("Aborted");
  txn.abort(abortCause);
  try {
      txn.join(participant);
      fail("Expected TransactionNotActiveException");
  } catch (TransactionNotActiveException e) {
View Full Code Here

  assertAborted(abortCause);
    }

    @Test
    public void testAbortAbortedWithRetryableCause() throws Exception {
  Exception abortCause = new TransactionAbortedException("Aborted");
  txn.abort(abortCause);
  try {
      txn.abort(new IllegalArgumentException());
      fail("Expected TransactionNotActiveException");
  } catch (TransactionNotActiveException e) {
View Full Code Here

    @Test
    public void testAbortAbortedWithNonRetryableCause() throws Exception {
  Exception abortCause = new IllegalArgumentException();
  txn.abort(abortCause);
  try {
      txn.abort(new TransactionAbortedException("Aborted"));
      fail("Expected TransactionNotActiveException");
  } catch (TransactionNotActiveException e) {
      System.err.println(e);
      assertFalse(retryable(e));
      assertEquals(abortCause, e.getCause());
View Full Code Here

TOP

Related Classes of com.sun.sgs.app.TransactionAbortedException

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.