Package com.sun.messaging.jmq.jmsserver.data

Examples of com.sun.messaging.jmq.jmsserver.data.BaseTransaction


  }

  private BaseTransaction parseTransactionWork(byte[] data)
      throws IOException {
    try {
      BaseTransaction txnWork = TransactionWorkFactory
          .readFromBytes(data);

      return txnWork;
    } catch (Throwable t) {
      logger.log(logger.ERROR, parent.storeName
View Full Code Here


      txnDataSize = r.readInt();

      byte[] data = new byte[txnDataSize];
      r.read(data);
      BaseTransaction txnWork = TransactionWorkFactory
          .readFromBytes(data);

      return txnWork;
    } catch (Throwable t) {
      logger.log(logger.ERROR, parent.storeName
View Full Code Here

      // b) stored incomplete (prepare occurred before last checkpoint,
      //    completion not written to prepared store yet)
      //    This should therefore be the last entry in log.
      // c) stored complete (prepare occurred before last checkpoint,
      //    and failure occurred after completion stored in prepared store
      BaseTransaction existingWork = null;
      if (incompleteUnstored.containsKey(tid)) {
        // a) unstored (prepare replayed earlier)
        existingWork = removeFromIncompleteUnstored(tid);
      } else if (incompleteStored.containsKey(tid)) {
        // b) stored incomplete (prepare occurred before last checkpoint,
View Full Code Here

      // b) stored incomplete (prepare occurred before last checkpoint,
      //    completion not written to prepared store yet)
      //    This should therefore be the last entry in log.
      // c) stored complete (prepare occurred before last checkpoint,
      //    and failure occurred after completion stored in prepared store
      BaseTransaction existingWork = null;
      if (incompleteUnstored.containsKey(tid)) {
        // a) unstored (prepare replayed earlier)
        existingWork = removeFromIncompleteUnstored(tid);
      } else if (incompleteStored.containsKey(tid)) {
        // b) stored incomplete (prepare occurred before last checkpoint,
        //    completion not written to prepared store yet)

        existingWork = removeFromIncompleteStored(tid);

        updateStoredState(tid, state);

        addToCompleteStored(existingWork);
      } else if (completeStored.containsKey(tid)) {
        // c) stored complete (prepare occurred before last checkpoint,
        //    and failure occurred after completion stored in prepared store
        existingWork = completeStored.get(tid);
      }
      if (existingWork != null) {
        if (state == TransactionState.COMMITTED) {
          transactionLogManager.transactionLogReplayer.replayTransactionWork(existingWork
              .getTransactionWork(), tid, dstLoadedSet);
        }
      } else {
        logger.log(Logger.ERROR,
            "Could not find prepared work for completing two-phase transaction "
View Full Code Here

    }
    List<BaseTransaction> list = baseTxnManager
        .getAllIncompleteTransactions();
    Iterator<BaseTransaction> iter = list.iterator();
    while (iter.hasNext()) {
      BaseTransaction baseTxn = iter.next();

      try {
        converter.convert(baseTxn);
      } catch (BrokerException be) {
        logger.logStack(Logger.ERROR, be.getMessage(), be);
View Full Code Here

  public HashMap getAllTransactionsMap() {
    List<BaseTransaction> txns = getAllIncompleteTransactions();
    HashMap map = new HashMap(txns.size());
    Iterator<BaseTransaction> itr = txns.iterator();
    while (itr.hasNext()) {
      BaseTransaction txn = itr.next();
      TransactionState txnState = new TransactionState(txn
          .getTransactionState());
      map.put(txn.getTid(), txnState);
    }
    return map;
  }
View Full Code Here

      logger.log(Logger.DEBUG, msg);
    }
  }

  BaseTransaction removeFromIncompleteStored(TransactionUID tid) {
    BaseTransaction result = incompleteStored.remove(tid);
    if (Store.getDEBUG()) {
      String msg = getPrefix()

      + " removing  " + tid + " from incompleteStored. Total = "
          + incompleteStored.size();
View Full Code Here

      logger.log(Logger.DEBUG, msg);
    }
  }

  BaseTransaction removeFromIncompleteUnstored(TransactionUID tid) {
    BaseTransaction result = incompleteUnstored.remove(tid);
    if (Store.getDEBUG()) {
      String msg = getPrefix()

      + " removing  " + tid + " from incompleteUnstored. Total = "
          + incompleteUnstored.size();
View Full Code Here

    synchronized(incompleteUnstored) {
      incmps = new ArrayList<TransactionUID>(incompleteUnstored.keySet());
    }

    TransactionUID tid = null;
    BaseTransaction baseTxn = null;
    Iterator<TransactionUID> iter = incmps.iterator();
    while (iter.hasNext()) {
      tid = iter.next();
      if (!preparedTxnStore.containsTransaction(tid)) {
        baseTxn = (BaseTransaction)incompleteUnstored.get(tid);
View Full Code Here

  }
 
  void rollbackTransactions(Collection<BaseTransaction> txns) {
    Iterator<BaseTransaction> iter = txns.iterator();
    while (iter.hasNext()) {
      BaseTransaction txn = iter.next();
      try {
        processTxnCompletion(txn.getTid(), TransactionState.ROLLEDBACK,
            true);
      } catch (IOException ioe) {
        logger.log(Logger.ERROR, "could not rollback " + txn, ioe);

      } catch (BrokerException be) {
View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.jmsserver.data.BaseTransaction

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.