Package net.jini.core.transaction

Examples of net.jini.core.transaction.UnknownTransactionException


  }

        if (txn == null) {
      final String msg = "unknown transaction [mgr:" + mgr +
    ", id:" + id + "], passed to abort/prepare/commit";
      final UnknownTransactionException ute =
    new UnknownTransactionException(msg);
      if (txnLogger.isLoggable(Levels.FAILED))
    txnLogger.log(Levels.FAILED, msg, ute);
      throw ute;
  }
        return txn;
View Full Code Here


        try {
            return (ServerTransaction) baseTr;
        } catch (ClassCastException e) {
      final String msg = "unexpected transaction type:" +
    baseTr.getClass();
      final UnknownTransactionException ute =
    new UnknownTransactionException(msg);
      if (txnLogger.isLoggable(Levels.FAILED))
    txnLogger.log(Levels.FAILED, msg, ute);
      throw ute;
        }
    }
View Full Code Here

  }

        if (txn == null) {
      final String msg = "unknown transaction [mgr:" + mgr +
    ", id:" + id + "], passed to abort/prepare/commit";
      final UnknownTransactionException ute =
    new UnknownTransactionException(msg);
      if (txnLogger.isLoggable(Levels.FAILED))
    txnLogger.log(Levels.FAILED, msg, ute);
      throw ute;
  }
        return txn;
View Full Code Here

        try {
            return (ServerTransaction) baseTr;
        } catch (ClassCastException e) {
      final String msg = "unexpected transaction type:" +
    baseTr.getClass();
      final UnknownTransactionException ute =
    new UnknownTransactionException(msg);
      if (txnLogger.isLoggable(Levels.FAILED))
    txnLogger.log(Levels.FAILED, msg, ute);
      throw ute;
        }
    }
View Full Code Here

        TxnManagerTransaction txntr =
    (TxnManagerTransaction) txns.get(new Long(id));

  if (txntr == null)
      throw new UnknownTransactionException("unknown transaction");

  // txntr.join does expiration check
  txntr.join(preparedTarget, crashCount);
        if (operationsLogger.isLoggable(Level.FINER)) {
            operationsLogger.exiting(
View Full Code Here

        TxnManagerTransaction txntr =
          (TxnManagerTransaction) txns.get(new Long(id));

  if (txntr == null)
      throw new UnknownTransactionException("unknown transaction");
        /* Expiration checks are only meaningful for active transactions. */
        /* NOTE:
   * 1) Cancellation sets expiration to 0 without changing state
   * from Active right away. Clients are supposed to treat
   * UnknownTransactionException just like Aborted, so it's OK to send
   * in this case.
   * 2) Might be a small window where client is committing the transaction
   * close to the expiration time. If the committed transition takes
   * place between getState() and ensureCurrent then the client could get
   * a false result.
   */
//TODO - need better locking here. getState and expiration need to be checked atomically 
        int state = txntr.getState();
        if (state == ACTIVE && !ensureCurrent(txntr))
      throw new UnknownTransactionException("unknown transaction");
     
  if (operationsLogger.isLoggable(Level.FINER)) {
            operationsLogger.exiting(
    TxnManagerImpl.class.getName(), "getState",
          new Integer(state));
View Full Code Here

            transactionsLogger.log(Level.FINEST,
          "Retrieved TxnManagerTransaction: {0}", txntr);
  }

  if (txntr == null)
      throw new UnknownTransactionException("Unknown transaction");

  // txntr.commit does expiration check
  txntr.commit(waitFor);
        txns.remove(new Long(id));
View Full Code Here

      } else {
        throw new CannotAbortException("Already committed");
      }
    }
  } else
      throw new UnknownTransactionException("No such transaction ["+id+"]");
  }

  txntr.abort(waitFor);
  txns.remove(new Long(id));
View Full Code Here

        TxnManagerTransaction txntr =
          (TxnManagerTransaction) txns.get(new Long(id));

  if (txntr == null)
      throw new UnknownTransactionException("unknown transaction");

        Transaction tn = (Transaction) txntr.getTransaction();
        ServerTransaction tr = serverTransaction(tn);

        if (tr == null)
           throw new UnknownTransactionException(
               "TxnManagerImpl: getTransaction: "
                                             + "unable to find transaction(" +
               id + ")");
//TODO - use IDs vs equals              
        if (!tr.mgr.equals(this))
            throw new UnknownTransactionException("wrong manager (" + tr.mgr +
              " instead of " + this + ")");

        return tr;
    }
View Full Code Here

                operationsLogger.exiting(TxnManagerImpl.class.getName(),
                 "serverTransaction", baseTr);
      }
            return (ServerTransaction) baseTr;
        } catch (ClassCastException e) {
            throw new UnknownTransactionException("unexpected transaction type");
        }
    }
View Full Code Here

TOP

Related Classes of net.jini.core.transaction.UnknownTransactionException

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.