Path: blob/master/src/java.transaction.xa/share/classes/javax/transaction/xa/XAException.java
41159 views
/*1* Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.transaction.xa;2627/**28* The XAException is thrown by the Resource Manager (RM) to inform the29* Transaction Manager of an error encountered by the involved transaction.30*31* @since 1.432*/33public class XAException extends Exception {3435/**36* Specify serialVersionUID for backward compatibility37*/38private static final long serialVersionUID = -8249683284832867751L;3940/**41* The error code with which to create the SystemException.42*43* @serial The error code for the exception44*/45public int errorCode;4647/**48* Create an XAException.49*/50public XAException() {51super();52}5354/**55* Create an XAException with a given string.56*57* @param s The <code>String</code> object containing the exception58* message.59*/60public XAException(String s) {61super(s);62}6364/**65* Create an XAException with a given error code.66*67* @param errcode The error code identifying the exception.68*/69public XAException(int errcode) {70super();71errorCode = errcode;72}7374/**75* The inclusive lower bound of the rollback codes.76*/77public static final int XA_RBBASE = 100;7879/**80* Indicates that the rollback was caused by an unspecified reason.81*/82public static final int XA_RBROLLBACK = XA_RBBASE;8384/**85* Indicates that the rollback was caused by a communication failure.86*/87public static final int XA_RBCOMMFAIL = XA_RBBASE + 1;8889/**90* A deadlock was detected.91*/92public static final int XA_RBDEADLOCK = XA_RBBASE + 2;9394/**95* A condition that violates the integrity of the resource was detected.96*/97public static final int XA_RBINTEGRITY = XA_RBBASE + 3;9899/**100* The resource manager rolled back the transaction branch for a reason101* not on this list.102*/103public static final int XA_RBOTHER = XA_RBBASE + 4;104105/**106* A protocol error occurred in the resource manager.107*/108public static final int XA_RBPROTO = XA_RBBASE + 5;109110/**111* A transaction branch took too long.112*/113public static final int XA_RBTIMEOUT = XA_RBBASE + 6;114115/**116* May retry the transaction branch.117*/118public static final int XA_RBTRANSIENT = XA_RBBASE + 7;119120/**121* The inclusive upper bound of the rollback error code.122*/123public static final int XA_RBEND = XA_RBTRANSIENT;124125/**126* Resumption must occur where the suspension occurred.127*/128public static final int XA_NOMIGRATE = 9;129130/**131* The transaction branch may have been heuristically completed.132*/133public static final int XA_HEURHAZ = 8;134135/**136* The transaction branch has been heuristically committed.137*/138public static final int XA_HEURCOM = 7;139140/**141* The transaction branch has been heuristically rolled back.142*/143public static final int XA_HEURRB = 6;144145/**146* The transaction branch has been heuristically committed and147* rolled back.148*/149public static final int XA_HEURMIX = 5;150151/**152* Routine returned with no effect and may be reissued.153*/154public static final int XA_RETRY = 4;155156/**157* The transaction branch was read-only and has been committed.158*/159public static final int XA_RDONLY = 3;160161/**162* There is an asynchronous operation already outstanding.163*/164public static final int XAER_ASYNC = -2;165166/**167* A resource manager error has occurred in the transaction branch.168*/169public static final int XAER_RMERR = -3;170171/**172* The XID is not valid.173*/174public static final int XAER_NOTA = -4;175176/**177* Invalid arguments were given.178*/179public static final int XAER_INVAL = -5;180181/**182* Routine was invoked in an inproper context.183*/184public static final int XAER_PROTO = -6;185186/**187* Resource manager is unavailable.188*/189public static final int XAER_RMFAIL = -7;190191/**192* The XID already exists.193*/194public static final int XAER_DUPID = -8;195196/**197* The resource manager is doing work outside a global transaction.198*/199public static final int XAER_OUTSIDE = -9;200}201202203