public void start(Xid xid, int flags) throws XAException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "start", new Object[]{"XID="+xid, _manager.xaFlagsToString(flags)});

        if (_currentTran != null)
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Cannot associate with XAResource. It is already associated with an Xid!", "CurrentXID="+_currentPtid);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
            throw new XAException(XAException.XAER_PROTO);
        }

        try
        {
            _currentPtid = new PersistentTranId(xid);

            // Feature SIB0048c.ms.1
            // Check our flags and either start a new association or
            // resume/join a previously created branch.
            if (flags == TMNOFLAGS)
            {
                _currentTran = new XidParticipant(_ms, _currentPtid, _persistence, _maxSize);

                _manager.start(_currentPtid, _currentTran);

            }
            else
            {
                _currentTran = _manager.start(_currentPtid, flags);
            }
        }
        catch (XidUnknownException xue)
        {
            com.ibm.ws.ffdc.FFDCFilter.processException(xue, "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.start", "1:316:1.51.1.7", this);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Cannot TMJOIN with this Xid. It is not known!", xue);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
            XAException xaException = new XAException(XAException.XAER_PROTO);
            xaException.initCause(xue);
            throw xaException;
        }
        catch (XidAlreadyKnownException xake)
        {
            com.ibm.ws.ffdc.FFDCFilter.processException(xake, "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.start", "1:325:1.51.1.7", this);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Cannot start new association with this Xid. It is already known!", xake);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
            XAException xaException = new XAException(XAException.XAER_DUPID);
            xaException.initCause(xake);
            throw xaException;
        }
        catch (Exception e)
        {
            com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.start", "1:334:1.51.1.7", this);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Unexpected exception caught during transaction association!", e);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
            XAException xaException = new XAException(XAException.XAER_RMERR);
            xaException.initCause(e);
            throw xaException;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
    }
public void start ( Xid xid , int flags ) throws XAException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "start" , new Object [ ] { "XID=" + xid , _manager . xaFlagsToString ( flags ) } ) ; if ( _currentTran != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Cannot associate with XAResource. It is already associated with an Xid!" , "CurrentXID=" + _currentPtid ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "start" ) ; throw new XAException ( XAException . XAER_PROTO ) ; } try { _currentPtid = new PersistentTranId ( xid ) ; if ( flags == TMNOFLAGS ) { _currentTran = new XidParticipant ( _ms , _currentPtid , _persistence , _maxSize ) ; _manager . start ( _currentPtid , _currentTran ) ; } else { _currentTran = _manager . start ( _currentPtid , flags ) ; } } catch ( XidUnknownException xue ) { com . ibm . ws . ffdc . FFDCFilter . processException ( xue , "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.start" , "1:316:1.51.1.7" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Cannot TMJOIN with this Xid. It is not known!" , xue ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "start" ) ; XAException xaException = new XAException ( XAException . XAER_PROTO ) ; xaException . initCause ( xue ) ; throw xaException ; } catch ( XidAlreadyKnownException xake ) { com . ibm . ws . ffdc . FFDCFilter . processException ( xake , "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.start" , "1:325:1.51.1.7" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Cannot start new association with this Xid. It is already known!" , xake ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "start" ) ; XAException xaException = new XAException ( XAException . XAER_DUPID ) ; xaException . initCause ( xake ) ; throw xaException ; } catch ( Exception e ) { com . ibm . ws . ffdc . FFDCFilter . processException ( e , "com.ibm.ws.sib.msgstore.transactions.MSDelegatingXAResource.start" , "1:334:1.51.1.7" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Unexpected exception caught during transaction association!" , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "start" ) ; XAException xaException = new XAException ( XAException . XAER_RMERR ) ; xaException . initCause ( e ) ; throw xaException ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "start" ) ; }
Associates a resource with a transaction branch. In our case each XID
will map to a MessageStore {@link XidParticipant} object.

@param xid    The identifier of the global transaction branch to associate this resource with.
@param flags  Association flag
<BR>TMNOFLAGS - New XID, start a new MS transaction.
<BR>TMJOIN - Join an existing global transaction.
<BR>TMRESUME - Resume a previously suspended transaction.

@exception XAException
Thrown if the XID is already known or this XAResource
is currently associated with a different XID.