Package org.jboss.jms.exception

Examples of org.jboss.jms.exception.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


      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

      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

      ClientTransaction newTx = getTxInternal(xid);

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

      //Remove the local tx

      ClientTransaction local = removeTxInternal(localTx);

      if (local == null)
      {
         throw new MessagingXAException(XAException.XAER_NOTA, "Cannot find transaction with xid:" + localTx);
      }

      newTx.mergeIn(local);
      return xid;
   }
View Full Code Here

            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

      {
         connection.sendTransaction(request, false);
      }
      catch (JMSSecurityException security)
      {
         MessagingXAException xaEx = new MessagingXAException(XAException.XA_RBROLLBACK, "A security exception happend!", security);
         log.error(xaEx, xaEx);
         throw xaEx;
      }
      catch (Throwable t)
      {
         //Catch anything else

         //We assume that any error is recoverable - and the recovery manager should retry again
         //either after the network connection has been repaired (if that was the problem), or
         //the server has been fixed.

         //(In some cases it will not be possible to fix so the user will have to manually resolve the tx)

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

      Object currentXid = sessionState.getCurrentTxId();

      // Sanity check
      if (currentXid == null)
      {
         throw new MessagingXAException(XAException.XAER_RMFAIL, "Current xid is not set");
      }

      if (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 :
               if(convertTx)
               {
                  setCurrentTransactionId(rm.convertOnJoinTx((LocalTx)sessionState.getCurrentTxId(), xid));
               }
               else
               {
                  setCurrentTransactionId(rm.joinTx(xid));
               }
               break;
            case TMRESUME :
               if(convertTx)
               {
                  setCurrentTransactionId(rm.convertOnJoinTx((LocalTx)sessionState.getCurrentTxId(), xid));
               }
               else
               {
                  setCurrentTransactionId(rm.resumeTx(xid));
               }

               break;
            default:
               throw new MessagingXAException(XAException.XAER_PROTO, "Invalid flags: " + flags);
         }
      }
   }
View Full Code Here

               break;
            case TMSUCCESS :
               rm.endTx(xid, true);
               break;
            default :
               throw new MessagingXAException(XAException.XAER_PROTO, "Invalid flags: " + flags);
         }
      }
   }
View Full Code Here

     
      ClientTransaction state = getTxInternal(xid);
     
      if (state != null)
      {
         throw new MessagingXAException(XAException.XAER_DUPID, "Transaction already exists with xid " + xid);
      }
           
      transactions.put(xid, new ClientTransaction());
     
      return xid;
View Full Code Here

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

TOP

Related Classes of org.jboss.jms.exception.MessagingXAException

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.