duke@1: /* ohair@158: * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. duke@1: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@1: * duke@1: * This code is free software; you can redistribute it and/or modify it duke@1: * under the terms of the GNU General Public License version 2 only, as ohair@158: * published by the Free Software Foundation. Oracle designates this duke@1: * particular file as subject to the "Classpath" exception as provided ohair@158: * by Oracle in the LICENSE file that accompanied this code. duke@1: * duke@1: * This code is distributed in the hope that it will be useful, but WITHOUT duke@1: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@1: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@1: * version 2 for more details (a copy is included in the LICENSE file that duke@1: * accompanied this code). duke@1: * duke@1: * You should have received a copy of the GNU General Public License version duke@1: * 2 along with this work; if not, write to the Free Software Foundation, duke@1: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@1: * ohair@158: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@158: * or visit www.oracle.com if you need additional information or have any ohair@158: * questions. duke@1: */ duke@1: duke@1: package javax.transaction.xa; duke@1: duke@1: /** duke@1: * The XAException is thrown by the Resource Manager (RM) to inform the duke@1: * Transaction Manager of an error encountered by the involved transaction. duke@1: * duke@1: */ duke@1: public class XAException extends java.lang.Exception { duke@1: duke@1: /** duke@1: * The error code with which to create the SystemException. duke@1: * duke@1: * @serial The error code for the exception duke@1: */ duke@1: duke@1: public int errorCode; duke@1: duke@1: /** duke@1: * Create an XAException. duke@1: */ duke@1: public XAException() duke@1: { duke@1: super(); duke@1: } duke@1: duke@1: /** duke@1: * Create an XAException with a given string. duke@1: * duke@1: * @param s The String object containing the exception duke@1: * message. duke@1: */ duke@1: public XAException(String s) duke@1: { duke@1: super(s); duke@1: } duke@1: duke@1: /** duke@1: * Create an XAException with a given error code. duke@1: * duke@1: * @param errcode The error code identifying the exception. duke@1: */ duke@1: public XAException(int errcode) duke@1: { duke@1: super(); duke@1: errorCode = errcode; duke@1: } duke@1: duke@1: /** duke@1: * The inclusive lower bound of the rollback codes. duke@1: */ duke@1: public final static int XA_RBBASE = 100; duke@1: duke@1: /** duke@1: * Indicates that the rollback was caused by an unspecified reason. duke@1: */ duke@1: public final static int XA_RBROLLBACK = XA_RBBASE; duke@1: duke@1: /** duke@1: * Indicates that the rollback was caused by a communication failure. duke@1: */ duke@1: public final static int XA_RBCOMMFAIL = XA_RBBASE + 1; duke@1: duke@1: /** duke@1: * A deadlock was detected. duke@1: */ duke@1: public final static int XA_RBDEADLOCK = XA_RBBASE + 2; duke@1: duke@1: /** duke@1: * A condition that violates the integrity of the resource was detected. duke@1: */ duke@1: public final static int XA_RBINTEGRITY = XA_RBBASE + 3; duke@1: duke@1: /** duke@1: * The resource manager rolled back the transaction branch for a reason duke@1: * not on this list. duke@1: */ duke@1: public final static int XA_RBOTHER = XA_RBBASE + 4; duke@1: duke@1: /** duke@1: * A protocol error occurred in the resource manager. duke@1: */ duke@1: public final static int XA_RBPROTO = XA_RBBASE + 5; duke@1: duke@1: /** duke@1: * A transaction branch took too long. duke@1: */ duke@1: public final static int XA_RBTIMEOUT = XA_RBBASE + 6; duke@1: duke@1: /** duke@1: * May retry the transaction branch. duke@1: */ duke@1: public final static int XA_RBTRANSIENT = XA_RBBASE + 7; duke@1: duke@1: /** duke@1: * The inclusive upper bound of the rollback error code. duke@1: */ duke@1: public final static int XA_RBEND = XA_RBTRANSIENT; duke@1: duke@1: /** duke@1: * Resumption must occur where the suspension occurred. duke@1: */ duke@1: public final static int XA_NOMIGRATE = 9; duke@1: duke@1: /** duke@1: * The transaction branch may have been heuristically completed. duke@1: */ duke@1: public final static int XA_HEURHAZ = 8; duke@1: duke@1: /** duke@1: * The transaction branch has been heuristically committed. duke@1: */ duke@1: public final static int XA_HEURCOM = 7; duke@1: duke@1: /** duke@1: * The transaction branch has been heuristically rolled back. duke@1: */ duke@1: public final static int XA_HEURRB = 6; duke@1: duke@1: /** duke@1: * The transaction branch has been heuristically committed and duke@1: * rolled back. duke@1: */ duke@1: public final static int XA_HEURMIX = 5; duke@1: duke@1: /** duke@1: * Routine returned with no effect and may be reissued. duke@1: */ duke@1: public final static int XA_RETRY = 4; duke@1: duke@1: /** duke@1: * The transaction branch was read-only and has been committed. duke@1: */ duke@1: public final static int XA_RDONLY = 3; duke@1: duke@1: /** duke@1: * There is an asynchronous operation already outstanding. duke@1: */ duke@1: public final static int XAER_ASYNC = -2; duke@1: duke@1: /** duke@1: * A resource manager error has occurred in the transaction branch. duke@1: */ duke@1: public final static int XAER_RMERR = -3; duke@1: duke@1: /** duke@1: * The XID is not valid. duke@1: */ duke@1: public final static int XAER_NOTA = -4; duke@1: duke@1: /** duke@1: * Invalid arguments were given. duke@1: */ duke@1: public final static int XAER_INVAL = -5; duke@1: duke@1: /** duke@1: * Routine was invoked in an inproper context. duke@1: */ duke@1: public final static int XAER_PROTO = -6; duke@1: duke@1: /** duke@1: * Resource manager is unavailable. duke@1: */ duke@1: public final static int XAER_RMFAIL = -7; duke@1: duke@1: /** duke@1: * The XID already exists. duke@1: */ duke@1: public final static int XAER_DUPID = -8; duke@1: duke@1: /** duke@1: * The resource manager is doing work outside a global transaction. duke@1: */ duke@1: public final static int XAER_OUTSIDE = -9; duke@1: duke@1: duke@1: }