public void commit(Xid xid, boolean onePhase) throws XAException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "commit", "XID="+xid+", OnePhase="+onePhase);

        try
        {
            // Commit the MessageStore Transaction to
            // ensure our in-memory model is in-line
            // with the persistent store.
            _manager.commit(new PersistentTranId(xid), onePhase);

        }
        catch (XidUnknownException xue)
        {
            com.ibm.ws.ffdc.FFDCFilter.processException(xue, "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.commit", "1:536:1.51.1.7", this);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Cannot commit transaction branch, Xid is unknown!", xue);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commit");
            XAException xaException = new XAException(XAException.XAER_NOTA);
            xaException.initCause(xue);
            throw xaException;
        }
        catch (XidStillAssociatedException xsae)
        {
            com.ibm.ws.ffdc.FFDCFilter.processException(xsae, "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.commit", "1:545:1.51.1.7", this);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Cannot commit transaction branch, resources are still associated with this Xid!", xsae);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commit");
            XAException xaException = new XAException(XAException.XAER_PROTO);
            xaException.initCause(xsae);
            throw xaException;
        }
        catch (ProtocolException tpe)
        {
            com.ibm.ws.ffdc.FFDCFilter.processException(tpe, "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.commit", "1:554:1.51.1.7", this);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "A Transaction protocol error occurred during prepare of transaction branch!", tpe);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commit");
            XAException xaException = new XAException(XAException.XAER_PROTO);
            xaException.initCause(tpe);
            throw xaException;
        }
        catch (RollbackException rbe)
        {
            com.ibm.ws.ffdc.FFDCFilter.processException(rbe, "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.commit", "1:563:1.51.1.7", this);


            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "RollbackException caught during commit of transaction branch!", rbe);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commit");
            XAException xaException = new XAException(XAException.XA_RBROLLBACK);
            xaException.initCause(rbe);
            throw xaException;
        }
        catch (SeverePersistenceException spe)
        {
            com.ibm.ws.ffdc.FFDCFilter.processException(spe, "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.commit", "1:582:1.51.1.7", this);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Unexpected error occurred during commit of transaction branch!", spe);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commit");
            XAException xaException = new XAException(XAException.XAER_RMFAIL);
            xaException.initCause(spe);
            throw xaException;
        }
        catch (PersistenceException pe)
        {
            com.ibm.ws.ffdc.FFDCFilter.processException(pe, "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.commit", "1:591:1.51.1.7", this);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Unexpected error occurred whilst persisting transaction work!", pe);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commit");
            XAException xaException = new XAException(XAException.XA_RETRY);
            xaException.initCause(pe);
            throw xaException;
        }
        catch (TransactionException te)
        {
            com.ibm.ws.ffdc.FFDCFilter.processException(te, "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.commit", "1:600:1.51.1.7", this);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Unexpected error occurred during commit of transaction branch!", te);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commit");
            XAException xaException = new XAException(XAException.XAER_RMFAIL);
            xaException.initCause(te);
            throw xaException;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commit");
    }
public void commit ( Xid xid , boolean onePhase ) throws XAException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "commit" , "XID=" + xid + ", OnePhase=" + onePhase ) ; try { _manager . commit ( new PersistentTranId ( xid ) , onePhase ) ; } catch ( XidUnknownException xue ) { com . ibm . ws . ffdc . FFDCFilter . processException ( xue , "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.commit" , "1:536:1.51.1.7" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Cannot commit transaction branch, Xid is unknown!" , xue ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "commit" ) ; XAException xaException = new XAException ( XAException . XAER_NOTA ) ; xaException . initCause ( xue ) ; throw xaException ; } catch ( XidStillAssociatedException xsae ) { com . ibm . ws . ffdc . FFDCFilter . processException ( xsae , "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.commit" , "1:545:1.51.1.7" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Cannot commit transaction branch, resources are still associated with this Xid!" , xsae ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "commit" ) ; XAException xaException = new XAException ( XAException . XAER_PROTO ) ; xaException . initCause ( xsae ) ; throw xaException ; } catch ( ProtocolException tpe ) { com . ibm . ws . ffdc . FFDCFilter . processException ( tpe , "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.commit" , "1:554:1.51.1.7" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "A Transaction protocol error occurred during prepare of transaction branch!" , tpe ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "commit" ) ; XAException xaException = new XAException ( XAException . XAER_PROTO ) ; xaException . initCause ( tpe ) ; throw xaException ; } catch ( RollbackException rbe ) { com . ibm . ws . ffdc . FFDCFilter . processException ( rbe , "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.commit" , "1:563:1.51.1.7" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "RollbackException caught during commit of transaction branch!" , rbe ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "commit" ) ; XAException xaException = new XAException ( XAException . XA_RBROLLBACK ) ; xaException . initCause ( rbe ) ; throw xaException ; } catch ( SeverePersistenceException spe ) { com . ibm . ws . ffdc . FFDCFilter . processException ( spe , "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.commit" , "1:582:1.51.1.7" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Unexpected error occurred during commit of transaction branch!" , spe ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "commit" ) ; XAException xaException = new XAException ( XAException . XAER_RMFAIL ) ; xaException . initCause ( spe ) ; throw xaException ; } catch ( PersistenceException pe ) { com . ibm . ws . ffdc . FFDCFilter . processException ( pe , "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.commit" , "1:591:1.51.1.7" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Unexpected error occurred whilst persisting transaction work!" , pe ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "commit" ) ; XAException xaException = new XAException ( XAException . XA_RETRY ) ; xaException . initCause ( pe ) ; throw xaException ; } catch ( TransactionException te ) { com . ibm . ws . ffdc . FFDCFilter . processException ( te , "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.commit" , "1:600:1.51.1.7" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Unexpected error occurred during commit of transaction branch!" , te ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "commit" ) ; XAException xaException = new XAException ( XAException . XAER_RMFAIL ) ; xaException . initCause ( te ) ; throw xaException ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "commit" ) ; }
The second stage of completion in the two-phase-commit protocol. Once this method has
returned all work associated with this transaction participant should be complete. If
the onePhase parameter is true then the one-phase completion protocol will be used
and commit can be called without a preceding call to prepare.

@param xid      The identifier of the global transaction branch to commit.
@param onePhase Determines whether this commit action is one-phase
or two-phase. If two-phase then a previously successful
prepare call must have been made.

@exception XAException
Thrown if an error occurs during completion. Check the JTA specification for
details of the individual exception codes.