Examples of TransactionNotActiveException


Examples of com.sun.sgs.app.TransactionNotActiveException

  /** {@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

Examples of com.sun.sgs.app.TransactionNotActiveException

      /* 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

Examples of com.sun.sgs.app.TransactionNotActiveException

      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

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

Examples of com.sun.sgs.app.TransactionNotActiveException

        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

Examples of com.sun.sgs.app.TransactionNotActiveException

      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

Examples of com.sun.sgs.app.TransactionNotActiveException

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

Examples of com.sun.sgs.app.TransactionNotActiveException

  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

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

Examples of com.sun.sgs.app.TransactionNotActiveException

     * 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
TOP
Copyright © 2018 www.massapi.com. 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.