Package com.sun.sgs.app

Examples of com.sun.sgs.app.TransactionNotActiveException


     */
    static Transaction getCurrentTransaction() {
        Transaction txn = currentTransaction.get();

        if (txn == null) {
            throw new TransactionNotActiveException("no current transaction");
        }

        if (txn.isAborted()) {
            throw new TransactionNotActiveException("Transaction is aborted",
                                                    txn.getAbortCause());
        }

        txn.checkTimeout();

View Full Code Here


     * TransactionNotActiveException if it isn't.
     */
    static void checkTransaction(Transaction txn) {
  Transaction currentTxn = txnProxy.getCurrentTransaction();
  if (currentTxn != txn) {
      throw new TransactionNotActiveException(
     "mismatched transaction; expected " + currentTxn + ", got " +
    txn);
  }
    }
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

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

    /* -- Implement TransactionProxy -- */

    public Transaction getCurrentTransaction() {
  Transaction txn = threadTxn.get();
  if (txn == null) {
      throw new TransactionNotActiveException(
    "No transaction is active");
  }
  txn.checkTimeout();
  return txn;
    }
View Full Code Here

    {
  checkOid(oid);
  try {
      objectAccesses.reportObjectAccess(txn, oid, type);
  } catch (IllegalArgumentException e) {
      throw new TransactionNotActiveException(
          "Problem with transaction " + txn + ": " + e.getMessage(), e);
  }
    }
View Full Code Here

  Transaction txn, String name, AccessType type)
    {
  try {
      nameAccesses.reportObjectAccess(txn, getNameForAccess(name), type);
  } catch (IllegalArgumentException e) {
      throw new TransactionNotActiveException(
          "Problem with transaction " + txn + ": " + e.getMessage(), e);
  }
    }
View Full Code Here

     * TransactionNotActiveException if it isn't.
     */
    static void checkTransaction(Transaction txn) {
  Transaction currentTxn = txnProxy.getCurrentTransaction();
  if (currentTxn != txn) {
      throw new TransactionNotActiveException(
     "mismatched transaction; expected " + currentTxn + ", got " +
    txn);
  }
    }
View Full Code Here

     */
    static Transaction getCurrentTransaction() {
        Transaction txn = currentTransaction.get();

        if (txn == null) {
            throw new TransactionNotActiveException("no current transaction");
        }

        if (txn.isAborted()) {
            throw new TransactionNotActiveException("Transaction is aborted",
                                                    txn.getAbortCause());
        }

        txn.checkTimeout();

View Full Code Here

      return timeout;
  }

  public void checkTimeout() {
      if (inactive) {
    throw new TransactionNotActiveException(
        "The transaction is not active");
      } else if ((state.get() & PREPARED) != 0) {
    return;
      }
      long runningTime = System.currentTimeMillis() - getCreationTime();
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.