Examples of MessagingXAException


Examples of org.jboss.jms.util.MessagingXAException

      if (onePhase)
      {
         //Invalid xid
         if (tx == null)
         {      
            throw new MessagingXAException(XAException.XAER_NOTA, "Cannot find transaction with xid:" + xid);
         }
        
         checkAndRollbackXA(tx, xid);
        
         TransactionRequest request =
            new TransactionRequest(TransactionRequest.ONE_PHASE_COMMIT_REQUEST, null, tx);
        
         request.state = tx;   
        
         sendTransactionXA(request, connection);
      }
      else
      {
         if (tx != null)
         {
            if (tx.getState() != ClientTransaction.TX_PREPARED)
            {   
               throw new MessagingXAException(XAException.XAER_PROTO, "commit called for transaction, but it is not prepared");
            }
         }
         else
         {
            //It's possible we don't actually have the prepared tx here locally - this
View Full Code Here

Examples of org.jboss.jms.util.MessagingXAException

      {
         //For one phase rollback there is nothing to do on the server
        
         if (tx == null)
         {    
            throw new MessagingXAException(XAException.XAER_NOTA, "Cannot find transaction with xid:" + xid);
         }
      }
                 
      //we redeliver the messages
      //locally to their original consumers if they are still open or cancel them to the server
View Full Code Here

Examples of org.jboss.jms.util.MessagingXAException

     
      ClientTransaction state = getTxInternal(xid);
     
      if (state == null)
      {        
         throw new MessagingXAException(XAException.XAER_NOTA, "Cannot find transaction with xid:" + xid);
      }
     
      return xid;
   }
View Full Code Here

Examples of org.jboss.jms.util.MessagingXAException

     
      ClientTransaction state = getTxInternal(xid);
     
      if (state == null)
      {      
         throw new MessagingXAException(XAException.XAER_NOTA, "Cannot find transaction with xid:" + xid);
      }
     
      return xid;
   }
View Full Code Here

Examples of org.jboss.jms.util.MessagingXAException

      ClientTransaction state = getTxInternal(xid);
     
      if (state == null)
      {      
         throw new MessagingXAException(XAException.XAER_NOTA, "Cannot find transaction with xid:" + xid);
      }
     
      return xid;
   }
View Full Code Here

Examples of org.jboss.jms.util.MessagingXAException

     
      ClientTransaction newTx = getTxInternal(xid);

      if (newTx != null)
      {       
         throw new MessagingXAException(XAException.XAER_DUPID, "Transaction already exists:" + xid);
      }

      //Remove the local tx
     
      ClientTransaction local = removeTxInternal(localTx);

      if (local == null)
      {       
         throw new MessagingXAException(XAException.XAER_NOTA, "Cannot find transaction with xid:" + localTx);
      }
     
      // Add the local back in with the new xid
     
      transactions.put(xid, local);
View Full Code Here

Examples of org.jboss.jms.util.MessagingXAException

            return txs;
         }
         catch (JMSException e)
         {
            throw new MessagingXAException(XAException.XAER_RMFAIL, "Failed to get prepared transactions");
         }
      }
      else
      {
         return new Xid[0];
View Full Code Here

Examples of org.jboss.jms.util.MessagingXAException

        
         //Therefore we throw XA_RETRY
         //Note we DO NOT throw XAER_RMFAIL or XAER_RMERR since both if these will cause the Arjuna
         //tx mgr NOT to retry and the transaction will have to be resolve manually.
        
         throw new MessagingXAException(XAException.XA_RETRY, "A Throwable was caught in sending the transaction", t);
      }
   }
View Full Code Here

Examples of org.jboss.jms.util.MessagingXAException

        
         final String msg = "Rolled back tx branch to avoid possibility of duplicates http://jira.jboss.org/jira/browse/JBMESSAGING-883";
        
         if (xa)
         {
            return new MessagingXAException(XAException.XA_HEURRB, msg);
         }
         else
         {
            return new MessagingTransactionRolledBackException(msg);
         }           
View Full Code Here

Examples of org.jboss.jms.util.MessagingXAException

      Object currentXid = sessionState.getCurrentTxId();
     
      // Sanity check
      if (currentXid == null)
      {
         throw new MessagingXAException(XAException.XAER_RMFAIL, "Current xid is not set");
      }
     
      if (flags == TMNOFLAGS && sessionState.getCurrentTxId() instanceof LocalTx)
      {
         convertTx = true;
        
         if (trace) { log.trace("Converting local tx into global tx branch"); }
      }     

      //TODO why do we need this synchronized block?
      synchronized (this)
      {
         switch (flags)
         {
            case TMNOFLAGS :
               if (convertTx)
               {   
                  // If I commit/rollback the tx, then there is a short period of time between the
                  // AS (or whoever) calling commit on the tx and calling start to enrolling the
                  // session in a new tx. If the session has any listeners then in that period,
                  // messages can be received asychronously but we want them to be received in the
                  // context of a tx, so we convert.
                  // Also for an transacted delivery in a MDB we need to do this as discussed
                  // in fallbackToLocalTx()
                  setCurrentTransactionId(rm.convertTx((LocalTx)sessionState.getCurrentTxId(), xid));
               }
               else
               {                 
                  setCurrentTransactionId(rm.startTx(xid));                
               }
               break;
            case TMJOIN :
               setCurrentTransactionId(rm.joinTx(xid));
               break;
            case TMRESUME :
               setCurrentTransactionId(rm.resumeTx(xid));
               break;
            default:
               throw new MessagingXAException(XAException.XAER_PROTO, "Invalid flags: " + flags);
         }
      }
   }
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.