Examples of XAException


Examples of javax.transaction.xa.XAException

        if (tranState == null) {
            XAResourceManager rm = ra.getXAResourceManager();
            ContextManager inDoubtCM = rm.find(xid);
            // RM also does not know about this xid.
            if (inDoubtCM == null)
                throw new XAException(XAException.XAER_NOTA);
            ContextService csf = ContextService.getFactory();
            csf.setCurrentContextManager(inDoubtCM);
            try {
                rm.commit(inDoubtCM, xid_im, onePhase);
               
                // close the connection/transaction since it can never
                // be used again.
                inDoubtCM.cleanupOnError(StandardException.closeException());
                return;
            } catch (StandardException se) {
                // The rm threw an exception, clean it up in the approprate
                // context.  There is no transactionResource to handle the
                // exception for us.
                inDoubtCM.cleanupOnError(se);
                throw wrapInXAException(se);
            } finally {
                csf.resetCurrentContextManager(inDoubtCM);
            }
           
        }
       
        synchronized (tranState) {
            checkUserCredentials(tranState.creatingResource);
           
            // Check the transaction is no associated with
            // any XAResource.
            switch (tranState.associationState) {
                case XATransactionState.T0_NOT_ASSOCIATED:
                    break;
                   
                case XATransactionState.TRO_FAIL:
                    throw new XAException(tranState.rollbackOnlyCode);
                   
                default:
                    throw new XAException(XAException.XAER_PROTO);
            }
           
            if (tranState.suspendedList != null && tranState.suspendedList.size() != 0)
                throw new XAException(XAException.XAER_PROTO);
           
            if (tranState.isPrepared == onePhase)
                throw new XAException(XAException.XAER_PROTO);
           
            try {
                tranState.xa_commit(onePhase);
            } catch (SQLException sqle) {
                throw wrapInXAException(sqle);
View Full Code Here

Examples of org.apache.derby.client.am.XaException

            xaExceptionText.append(" : ").append(exceptionsOnXA.getMessage());
            exceptionsOnXA = (SqlException)
                    exceptionsOnXA.getNextException();
        }

        XaException xaException = new XaException(
                conn_.agent_.logWriter_,
                sqlExceptions,
                xaExceptionText.toString());

        xaException.errorCode = rc;
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.