Package com.sun.sgs.app

Examples of com.sun.sgs.app.TransactionNotActiveException


      case NOT_MODIFIED:
      case MAYBE_MODIFIED:
      case MODIFIED:
    break;
      case FLUSHED:
    exception = new TransactionNotActiveException(
        "Attempt to get the object associated with a managed" +
        " reference when its transaction is not active");
    break;
      case REMOVED_EMPTY:
      case REMOVED_FETCHED:
    throw new ObjectNotFoundException("The object is not found");
      default:
    throw new AssertionError();
      }
  } catch (TransactionNotActiveException e) {
      exception = new TransactionNotActiveException(
    "Attempt to get the object associated with a managed" +
    " reference when its transaction is not active: " +
    e.getMessage(),
    e);
  } catch (RuntimeException e) {
View Full Code Here


        context.store.markForUpdate(context.txn, oid);
    }
    state = State.MODIFIED;
    break;
      case FLUSHED:
    exception = new TransactionNotActiveException(
        "Attempt to get the object associated with a managed" +
        " reference when its transaction is not active");
    break;
      case NEW:
      case MODIFIED:
    break;
      case REMOVED_EMPTY:
      case REMOVED_FETCHED:
    throw new ObjectNotFoundException("The object is not found");
      default:
    throw new AssertionError();
      }
  } catch (TransactionNotActiveException e) {
      exception = new TransactionNotActiveException(
    "Attempt to get the object associated with a managed" +
    " reference when its transaction is not active: " +
    e.getMessage(),
    e);
  } catch (RuntimeException e) {
View Full Code Here

    public void checkTimeout() {
  if (state == State.ABORTED ||
      state == State.COMMITTED)
  {
      throw new TransactionNotActiveException(
    "Transaction is not active: " + state);
  } else if (state == State.ABORTING ||
       state == State.COMMITTING)
  {
      return;
View Full Code Here

    Level.FINER, "join {0} participant:{1}", this, participant);
  }
  if (participant == null) {
      throw new NullPointerException("Participant must not be null");
  } else if (state == State.ABORTED) {
      throw new TransactionNotActiveException(
    "Transaction not active", abortCause);
  } else if (state != State.ACTIVE) {
      throw new IllegalStateException(
    "Transaction not active: " + state);
  }
View Full Code Here

      logger.log(Level.FINER, "abort {0} cause:{1}", this, cause);
  }
  if (state == State.ABORTING) {
      return;
  } else if (state == State.ABORTED) {
      throw new TransactionNotActiveException(
    "Transaction is not active", abortCause);
  } else if (state != State.ACTIVE &&
       state != State.PREPARING &&
       state != State.PREPARED)
  {
View Full Code Here

    /** {@inheritDoc} */
    public void registerListener(TransactionListener listener) {
  if (listener == null) {
      throw new NullPointerException("The listener must not be null");
  } else if (state != State.ACTIVE) {
      throw new TransactionNotActiveException(
    "Transaction is not active");
  }
  listeners.add(listener);
    }
View Full Code Here

      return baos.toByteArray();
  } catch (ObjectIOException e) {
      check(object, e);
      throw e;
  } catch (TransactionNotActiveException e) {
      throw new TransactionNotActiveException(
    "Attempt to perform an operation during serialization that " +
    "requires a active transaction: " + e.getMessage(),
    e);
  } catch (IOException e) {
      throw new ObjectIOException(
View Full Code Here

    } catch (RuntimeException e) {
        logger.logThrow(Level.WARNING, e, "Commit failed");
    }
      }
  } else if (state == State.ABORTED) {
      throw new TransactionNotActiveException(
    "Transaction not active", abortCause);
  } else if (state != State.ACTIVE) {
      throw new IllegalStateException(
    "Transaction not active: " + state);
  } else if (usePrepareAndCommit && participants.size() == 1) {
View Full Code Here

  /** {@inheritDoc} */
  public boolean prepare(Transaction txn) throws Exception {
      try {
    T context = contextMap.checkTransaction(txn);
    if (context.isPrepared()) {
        throw new TransactionNotActiveException("Already prepared");
    }
    boolean readOnly = context.prepare();
    if (readOnly) {
        contextMap.clearContext();
    }
View Full Code Here

  /** {@inheritDoc} */
  public void prepareAndCommit(Transaction txn) throws Exception {
      try {
    T context = contextMap.checkTransaction(txn);
    if (context.isPrepared()) {
        throw new TransactionNotActiveException("Already prepared");
    }
    context.prepareAndCommit();
    contextMap.clearContext();
    logger.log(Level.FINER, "prepareAndCommit txn:{0} returns",
         txn);
View Full Code Here

TOP

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

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.