Package com.sun.sgs.app

Examples of com.sun.sgs.app.TransactionNotActiveException


     */
    void commit() throws Exception {
  checkThread("commit");
  logger.log(Level.FINER, "commit {0}", this);
  if (state == State.ABORTED) {
      throw new TransactionNotActiveException(
    "Transaction is not active", abortCause);
  } else if (state != State.ACTIVE) {
      throw new IllegalStateException(
    "Transaction is not active: " + state);
  }
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

      /* Fall through */
  case NEW:
      state = State.REMOVED_FETCHED;
      break;
  case FLUSHED:
      throw new TransactionNotActiveException(
    "Attempt to remove a managed object when its transaction is" +
    " not active");
  case REMOVED_EMPTY:
  case REMOVED_FETCHED:
      throw new ObjectNotFoundException("The object is not found");
View Full Code Here

      break;
  case MODIFIED:
  case NEW:
      break;
  case FLUSHED:
      throw new TransactionNotActiveException(
    "Attempt to mark a managed object for update when its" +
    " transaction is not active");
  case REMOVED_EMPTY:
  case REMOVED_FETCHED:
      throw new ObjectNotFoundException("The object is not found");
View Full Code Here

      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

      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

   * Throws a {@code TransactionNotActiveException} if this
   * transaction is prepared.
   */
  private void checkPrepared() {
      if (isPrepared) {
    throw new TransactionNotActiveException("Already prepared");
      }
  }
View Full Code Here

  ManagedReferenceImpl<?> result = objects.get(object);
  if (result == null &&
      trackStaleObjects &&
      staleObjects.containsKey(object))
  {
      throw new TransactionNotActiveException(
    "Attempt to access an object of type " +
    DataServiceImpl.typeName(object) +
    " whose transaction is no longer active");
  }
  return result;
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.