docs: public void end(Xid xid, int flags) throws XAException
     {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "end", new Object[]{xid, flags});
        
        // Are they wanting to suspend the current transaction?
        if ((flags & XAResource.TMSUSPEND) != 0)
        {
           if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "TMSUSPEND was specified");
           
           // Is the resource already in the map? If so, throw an exception
           if (suspendedTransactions.get(xid) != null)
           {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "XID is already suspended");
              
              throw new XAException(XAException.XAER_PROTO);
           }
           
           // Is this XId actually the one currently being used?
           if (currentXid != null && !currentXid.equals(xid))
           {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Attempt to suspend some other XId");
              
              throw new XAException(XAException.XAER_NOTA);
           }
           
           // Add this transaction to the suspended transactions map
           suspendedTransactions.put(xid, currentLiveXAResource);
           currentLiveXAResource.isSuspended = true;
           currentLiveXAResource.setEnlisted(null);
        }
        else
        {
           if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "TMSUSPEND was not specified");
           
           // Is the current XA Resource not active? If so then this is probably a call to
           // simply end a suspended transaction as you can transition to this state without first
           // restarting a suspended transaction.
           if (!currentLiveXAResource.isEnlisted())
           {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Currently not enlisted");
              
              // It is possible that this will be an end call to a suspended transaction (i.e. to skip
              // the restarting). Have a quick check for this XId in our suspended map
              BaseSIXAResourceProxy tx = suspendedTransactions.remove(xid);
              
              // If we find nothing here, then we were not started for this XId and this is a protocol
              // error
              if (tx == null)
              {
                 if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "No suspended XId found and not currently started");
                 throw new XAException(XAException.XAER_NOTA);
              }
              
              // Restart the suspended transaction
              currentLiveXAResource = tx;
              currentLiveXAResource.setEnlisted(xid);
           }
           
           currentLiveXAResource.isSuspended = false;
           currentLiveXAResource.end(xid, flags);
           
           // Here we can pool the SIXAResource if we have not already done so
           if (!useableXAResources.contains(currentLiveXAResource))
           {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Pooling the SIXAResource");
              useableXAResources.add(currentLiveXAResource);
           }
        }
        
        currentXid = null;
        
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "end");
     }