Package com.sun.sgs.app

Examples of com.sun.sgs.app.TransactionConflictException


    {
  if (convertTxnExceptions && e instanceof LockNotGrantedException) {
      return new TransactionTimeoutException(
    "Transaction timed out: " + e.getMessage(), e);
  } else if (convertTxnExceptions && e instanceof DeadlockException) {
      return new TransactionConflictException(
    "Transaction conflict: " + e.getMessage(), e);
  } else if (e instanceof RunRecoveryException) {
      /*
       * It is tricky to clean up the data structures in this instance in
       * order to reopen the Berkeley DB databases, because it's hard to
       * know when they are no longer in use.  It's OK to catch this
       * Error and create a new environment instance, but this instance
       * is dead.  -tjb@sun.com (10/19/2006)
       */
      Error error = new Error(
    "Database requires recovery -- need to restart: " + e, e);
      logger.logThrow(Level.SEVERE, error, "Database requires recovery");
      throw error;
  } else if (e instanceof XAException) {
      int errorCode = ((XAException) e).errorCode;
      if (errorCode == XA_RBTIMEOUT) {
    throw new TransactionTimeoutException(
        "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);
      }
View Full Code Here


   */
  if (convertTxnExceptions && e instanceof LockNotGrantedException) {
      return new TransactionTimeoutException(
    "Transaction timed out: " + e);
  } else if (convertTxnExceptions && e instanceof DeadlockException) {
      return new TransactionConflictException(
    "Transaction conflict: " + e);
  } else if (e instanceof RunRecoveryException) {
      /*
       * It is tricky to clean up the data structures in this instance in
       * order to reopen the Berkeley DB databases, because it's hard to
View Full Code Here

    case TIMEOUT:
        exception = new TransactionTimeoutException(
      accessMsg + "Transaction timed out" + conflictMsg);
        break;
    case DENIED:
        exception = new TransactionConflictException(
      accessMsg + "Access denied" + conflictMsg);
        break;
    case INTERRUPTED:
        exception = new TransactionInterruptedException(
      accessMsg + "Transaction interrupted" + conflictMsg);
        break;
    case DEADLOCK:
        exception = new TransactionConflictException(
      accessMsg + "Transaction deadlock" + conflictMsg);
        break;
    default:
        throw new AssertionError(
      "Should not be " + conflict.getType());
View Full Code Here

   */
  if (convertTxnExceptions && e instanceof LockNotGrantedException) {
      return new TransactionTimeoutException(
    "Transaction timed out: " + e);
  } else if (convertTxnExceptions && e instanceof DeadlockException) {
      return new TransactionConflictException(
    "Transaction conflict: " + e);
  } else if (e instanceof RunRecoveryException) {
      /*
       * It is tricky to clean up the data structures in this instance in
       * order to reopen the Berkeley DB databases, because it's hard to
View Full Code Here

    case TIMEOUT:
        exception = new TransactionTimeoutException(
      accessMsg + "Transaction timed out" + conflictMsg);
        break;
    case DENIED:
        exception = new TransactionConflictException(
      accessMsg + "Access denied" + conflictMsg);
        break;
    case INTERRUPTED:
        exception = new TransactionInterruptedException(
      accessMsg + "Transaction interrupted" + conflictMsg);
        break;
    case DEADLOCK:
        exception = new TransactionConflictException(
      accessMsg + "Transaction deadlock" + conflictMsg);
        break;
    default:
        throw new AssertionError(
      "Should not be " + conflict.getType());
View Full Code Here

    {
  if (convertTxnExceptions && e instanceof LockNotGrantedException) {
      return new TransactionTimeoutException(
    "Transaction timed out: " + e.getMessage(), e);
  } else if (convertTxnExceptions && e instanceof DeadlockException) {
      return new TransactionConflictException(
    "Transaction conflict: " + e.getMessage(), e);
  } else if (e instanceof RunRecoveryException) {
      /*
       * It is tricky to clean up the data structures in this instance in
       * order to reopen the Berkeley DB databases, because it's hard to
       * know when they are no longer in use.  It's OK to catch this
       * Error and create a new environment instance, but this instance
       * is dead.  -tjb@sun.com (10/19/2006)
       */
      Error error = new Error(
    "Database requires recovery -- need to restart: " + e, e);
      logger.logThrow(Level.SEVERE, error, "Database requires recovery");
      throw error;
  } else if (e instanceof XAException) {
      int errorCode = ((XAException) e).errorCode;
      if (errorCode == XA_RBTIMEOUT) {
    throw new TransactionTimeoutException(
        "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);
      }
View Full Code Here

        switch (conflict.getType()) {
        case TIMEOUT:
      throw new TransactionTimeoutException(
          accessMsg + "Transaction timed out" + conflictMsg);
        case DENIED:
      throw new TransactionConflictException(
          accessMsg + "Access denied" + conflictMsg);
        case INTERRUPTED:
      throw new TransactionInterruptedException(
          accessMsg + "Transaction interrupted" +
          conflictMsg);
        case DEADLOCK:
      throw new TransactionConflictException(
          accessMsg + "Transaction deadlock" + conflictMsg);
        default:
      throw new AssertionError(
          "Should not be " + conflict.getType());
        }
View Full Code Here

TOP

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

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.