Package javax.transaction.xa

Examples of javax.transaction.xa.XAException


            return xidArray;
         }
         catch (HornetQException e)
         {
            // This should never occur
            throw new XAException(XAException.XAER_RMERR);
         }
      }
      else
      {
         return new Xid[0];
View Full Code Here


            // if we retry and its not there the assume that it was rolled back
            if (xaRetry && response.getResponseCode() == XAException.XAER_NOTA)
            {
               return;
            }
            throw new XAException(response.getResponseCode());
         }
      }
      catch (HornetQException e)
      {
         if (e.getCode() == HornetQException.UNBLOCKED)
         {
            // Unblocked on failover
            xaRetry = true;
            throw new XAException(XAException.XA_RETRY);
         }
         // This should never occur
         throw new XAException(XAException.XAER_RMERR);
      }
   }
View Full Code Here

         return response.isOK();
      }
      catch (HornetQException e)
      {
         // This should never occur
         throw new XAException(XAException.XAER_RMERR);
      }
   }
View Full Code Here

            // Don't need to flush since the previous end will have done this
            packet = new SessionXAStartMessage(xid);
         }
         else
         {
            throw new XAException(XAException.XAER_INVAL);
         }

         SessionXAResponseMessage response = (SessionXAResponseMessage)channel.sendBlocking(packet);

         if (response.isError())
         {
            ClientSessionImpl.log.error("XA operation failed " + response.getMessage() +
                                        " code:" +
                                        response.getResponseCode());
            throw new XAException(response.getResponseCode());
         }
      }
      catch (HornetQException e)
      {
         // we can retry this only because we know for sure that no work would have been done
         if (e.getCode() == HornetQException.UNBLOCKED)
         {
            try
            {
               SessionXAResponseMessage response = (SessionXAResponseMessage)channel.sendBlocking(packet);

               if (response.isError())
               {
                  ClientSessionImpl.log.error("XA operation failed " + response.getMessage() +
                                              " code:" +
                                              response.getResponseCode());
                  throw new XAException(response.getResponseCode());
               }
            }
            catch (HornetQException e1)
            {
               // This should never occur
               throw new XAException(XAException.XAER_RMERR);
            }
         }
         // This should never occur
         throw new XAException(XAException.XAER_RMERR);
      }
   }
View Full Code Here

   private void checkXA() throws XAException
   {
      if (!xa)
      {
         ClientSessionImpl.log.error("Session is not XA");
         throw new XAException(XAException.XAER_RMERR);
      }
   }
View Full Code Here

   private void checkXA() throws XAException
   {
      if (!xa)
      {
         HornetQClientLogger.LOGGER.sessionNotXA();
         throw new XAException(XAException.XAER_RMERR);
      }
   }
View Full Code Here

         workDone = false;

         if (response.isError())
         {
            throw new XAException(response.getResponseCode());
         }

         if (HornetQClientLogger.LOGGER.isTraceEnabled())
         {
            HornetQClientLogger.LOGGER.trace("finished commit on " + convert(xid) + " with response = " + response);
         }
      }
      catch (HornetQException e)
      {
         HornetQClientLogger.LOGGER.failoverDuringCommit();

         // Unblocked on failover
         xaRetry = true;
         // Any error on commit -> RETRY
         // We can't rollback a Prepared TX for definition
         throw new XAException(XAException.XA_RETRY);
      }
      finally
      {
         endCall();
      }
View Full Code Here

            }
            catch (Exception ignored)
            {
               HornetQClientLogger.LOGGER.debug("Error on rollback during end call!", ignored);
            }
            throw new XAException(XAException.XA_RBOTHER);
         }

         try
         {
            Packet packet;

            if (flags == XAResource.TMSUSPEND)
            {
               packet = new PacketImpl(PacketImpl.SESS_XA_SUSPEND);
            }
            else if (flags == XAResource.TMSUCCESS)
            {
               packet = new SessionXAEndMessage(xid, false);
            }
            else if (flags == XAResource.TMFAIL)
            {
               packet = new SessionXAEndMessage(xid, true);
            }
            else
            {
               throw new XAException(XAException.XAER_INVAL);
            }

            flushAcks();

            SessionXAResponseMessage response;
            startCall();
            try
            {
               response = (SessionXAResponseMessage) channel.sendBlocking(packet, PacketImpl.SESS_XA_RESP);
            }
            finally
            {
               endCall();
            }

            if (response.isError())
            {
               throw new XAException(response.getResponseCode());
            }
         }
         catch (HornetQException e)
         {
            HornetQClientLogger.LOGGER.errorCallingEnd(e);
            // This should never occur
            throw new XAException(XAException.XAER_RMERR);
         }
      }
      finally
      {
         currentXID = null;
View Full Code Here

      {
         SessionXAResponseMessage response = (SessionXAResponseMessage) channel.sendBlocking(new SessionXAForgetMessage(xid), PacketImpl.SESS_XA_RESP);

         if (response.isError())
         {
            throw new XAException(response.getResponseCode());
         }
      }
      catch (HornetQException e)
      {
         // This should never occur
         throw new XAException(XAException.XAER_RMERR);
      }
      finally
      {
         endCall();
      }
View Full Code Here

         return response.getTimeoutSeconds();
      }
      catch (HornetQException e)
      {
         // This should never occur
         throw new XAException(XAException.XAER_RMERR);
      }
   }
View Full Code Here

TOP

Related Classes of javax.transaction.xa.XAException

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.