Examples of RemoteTransaction


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

      Globals.getLogger().log(Logger.DEBUG,
          getPrefix() + " replayTransactionEvent");
    }
    RemoteTransactionEvent remoteTxnEvent = (RemoteTransactionEvent) txnEvent;
    // replay to store on commit
    RemoteTransaction remoteTxn = remoteTxnEvent.remoteTransaction;
    int state = remoteTxn.getState();
    TransactionUID tid = remoteTxn.getTid();
    if (remoteTxnEvent.getSubType() == RemoteTransactionEvent.Type2PPrepareEvent) {
      // 2-phase prepare
      // check if it is stored
      // (this should only be the case if a failure occurred between saving
      // in prepared txn store and resetting the transaction log
      if (incompleteStored.containsKey(tid)) {
        if (Store.getDEBUG()) {
          String msg = getPrefix()
              + " found matching txn in prepared store on replay "
              + remoteTxn;
          Globals.getLogger().log(Logger.DEBUG, msg);
        }
      } else {
        addToIncompleteUnstored(remoteTxn);
      }

    } else if (remoteTxnEvent.getSubType() == RemoteTransactionEvent.Type2PCompleteEvent) {
      // we are completing a transaction
      // the transaction could be
      // a) unstored (prepare replayed earlier)
      // 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) {
        RemoteTransaction remoteTransaction = (RemoteTransaction)existingWork;
        if (state == TransactionState.COMMITTED) {
         
          TransactionAcknowledgement[] txnAcks = remoteTransaction.getTxnAcks();
          DestinationUID[] destIds = remoteTransaction.getDestIds();
          transactionLogManager.transactionLogReplayer.replayRemoteAcks(txnAcks, destIds, tid, dstLoadedSet);
        }
      } else {
        logger.log(Logger.ERROR,
            "Could not find prepared work for completing two-phase transaction "
View Full Code Here

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

 
  public void readFromBytes(byte[] data) throws IOException, BrokerException {
    ByteArrayInputStream bais = new ByteArrayInputStream(data);
    DataInputStream dis = new DataInputStream(bais);
    remoteTransaction = new RemoteTransaction();
    dis.skip(2);

    remoteTransaction.getTransactionDetails().readContent(dis);
   
    int objectBodySize = dis.readInt();
View Full Code Here

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

  void readFromBytes(byte[] data) throws IOException, BrokerException {
    ByteArrayInputStream bais = new ByteArrayInputStream(data);
    DataInputStream dis = new DataInputStream(bais);

    remoteTransaction = new RemoteTransaction();
    dis.skip(2);
    remoteTransaction.getTransactionDetails().readContent(dis);

    dis.close();
    bais.close();
View Full Code Here

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

  class RemoteTxnConverter extends TxnConverter {
    void convert(BaseTransaction baseTxn) throws BrokerException,
        IOException {

      RemoteTransaction remoteTxn = (RemoteTransaction) baseTxn;
      TransactionUID id = baseTxn.getTid();

      TransactionState ts = baseTxn.getTransactionState();

      store.storeRemoteTransaction(id, ts, remoteTxn.getTxnAcks(),
          remoteTxn.getTxnHomeBroker(), Destination.PERSIST_SYNC);
    }
View Full Code Here

Examples of edu.brown.hstore.txns.RemoteTransaction

        assert(this.isLocalPartition(fragment.getPartitionId())) :
            "Trying to queue work for " + ts + " at non-local partition " + fragment.getPartitionId();
       
        if (hstore_conf.site.specexec_enable && ts instanceof RemoteTransaction && fragment.hasFutureStatements()) {
            QueryEstimate query_estimate = fragment.getFutureStatements();
            RemoteTransaction remote_ts = (RemoteTransaction)ts;
            RemoteEstimatorState t_state = (RemoteEstimatorState)remote_ts.getEstimatorState();
            if (t_state == null) {
                t_state = this.remoteTxnEstimator.startTransaction(ts.getTransactionId(),
                                                                   ts.getBasePartition(),
                                                                   ts.getProcedure(),
                                                                   null);
                remote_ts.setEstimatorState(t_state);
            }
            if (debug.val)
                LOG.debug(String.format("%s - Updating %s with %d future statement hints for partition %d",
                          ts, t_state.getClass().getSimpleName(),
                          fragment.getFutureStatements().getStmtIdsCount(),
View Full Code Here

Examples of org.infinispan.transaction.RemoteTransaction

      if (ctx.getCacheTransaction() instanceof RemoteTransaction) {
         // If a commit is received for a transaction that doesn't have its 'lookedUpEntries' populated
         // we know for sure this transaction is 2PC and was received via state transfer but the preceding PrepareCommand
         // was not received by local node because it was executed on the previous key owners. We need to re-prepare
         // the transaction on local node to ensure its locks are acquired and lookedUpEntries is properly populated.
         RemoteTransaction remoteTx = (RemoteTransaction) ctx.getCacheTransaction();
         if (remoteTx.isMissingLookedUpEntries()) {
            remoteTx.setMissingLookedUpEntries(false);

            PrepareCommand prepareCommand;
            if (useVersioning) {
               prepareCommand = commandFactory.buildVersionedPrepareCommand(ctx.getGlobalTransaction(), ctx.getModifications(), false);
               WriteSkewHelper.setVersionsSeenOnPrepareCommand((VersionedPrepareCommand) prepareCommand, ctx);
View Full Code Here

Examples of org.infinispan.transaction.RemoteTransaction

      super.cleanupStaleTransactions(cacheTopology);
   }

   @Override
   public RemoteTransaction getRemoteTransaction(GlobalTransaction txId) {
      RemoteTransaction remoteTransaction = super.getRemoteTransaction(txId);
      if (remoteTransaction != null) return remoteTransaction;
      //also look in the recovery manager, as this transaction might be prepared
      return recoveryManager.getPreparedTransaction(((RecoverableTransactionIdentifier) txId).getXid());
   }
View Full Code Here

Examples of org.infinispan.transaction.RemoteTransaction

   public RemoteTransaction removeRemoteTransaction(Xid xid) {
      if (clustered) {
         Iterator<RemoteTransaction> it = getRemoteTransactions().iterator();
         while (it.hasNext()) {
            RemoteTransaction next = it.next();
            RecoverableTransactionIdentifier gtx = (RecoverableTransactionIdentifier) next.getGlobalTransaction();
            if (xid.equals(gtx.getXid())) {
               it.remove();
               recalculateMinTopologyIdIfNeeded(next);
               next.notifyOnTransactionFinished();
               return next;
            }
         }
      }
      return null;
View Full Code Here

Examples of org.infinispan.transaction.RemoteTransaction

         if (!transactionLog.hasPendingPrepare(command)) {
            if (trace) log.tracef("Applying pending prepare %s", command);
            commandsFactory.initializeReplicableCommand(command, false);
            RemoteTxInvocationContext ctx = invocationContextContainer.createRemoteTxInvocationContext(null /* No idea if this right PLM */);
            RemoteTransaction transaction = txTable.createRemoteTransaction(command.getGlobalTransaction(), command.getModifications());
            ctx.setRemoteTransaction(transaction);
            ctx.setFlags(CACHE_MODE_LOCAL, Flag.SKIP_CACHE_STATUS_CHECK);
            interceptorChain.invoke(ctx, command);
         } else {
            if (trace) log.tracef("Prepare %s not in tx log; not applying", command);
View Full Code Here

Examples of org.infinispan.transaction.RemoteTransaction

   }

   public Object perform(InvocationContext ctx) throws Throwable {
      if (ctx != null) throw new IllegalStateException("Expected null context!");
      markGtxAsRemote();
      RemoteTransaction transaction = txTable.getRemoteTransaction(globalTx);
      if (transaction == null) {
         if (trace) log.tracef("Did not find a RemoteTransaction for %s", globalTx);
         return invalidRemoteTxReturnValue();
      }
      visitRemoteTransaction(transaction);
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.