docs: @Override
      public void end(Xid xid, int flags) throws XAException {
  
          final boolean isTracingEnabled = TraceComponent.isAnyTracingEnabled();
  
          if (isTracingEnabled && tc.isEntryEnabled())
              Tr.entry(this, tc, "end");
  
          if (getMcWrapper().isMCAborted()) {
              Tr.exit(tc, "Connection was aborted. Exiting end.");
              return;
          }
  
          try {
              xaResource.end(xid, flags);
          } catch (XAException e) {
              processXAException(e);
              if (flags == XAResource.TMFAIL && ((e.errorCode >= XAException.XA_RBBASE) && (e.errorCode <= XAException.XA_RBEND))) {
                  // okay error codes for the rollback processing.
              } else {
                  com.ibm.ws.ffdc.FFDCFilter.processException(
                                                              e,
                                                              "com.ibm.ejs.j2c.XATransactionWrapper.end",
                                                              "417",
                                                              this);
                  if (!mcWrapper.isStale()) {
                      Tr.error(tc, "XA_RESOURCE_ADAPTER_OPERATION_ID_EXCP_J2CA0027", "end", xid, e, mcWrapper.gConfigProps.cfName);
                  }
                  if (isTracingEnabled && tc.isEntryEnabled())
                      Tr.exit(this, tc, "end", e);
                  throw e;
              }
          } catch (Exception e) {
              com.ibm.ws.ffdc.FFDCFilter.processException(
                                                          e,
                                                          "com.ibm.ejs.j2c.XATransactionWrapper.end",
                                                          "423",
                                                          this);
              if (!mcWrapper.shouldBeDestroyed()) {
                  mcWrapper.markTransactionError();
                  Tr.error(tc, "XA_RESOURCE_ADAPTER_OPERATION_ID_EXCP_J2CA0027", "end", xid, e, mcWrapper.gConfigProps.cfName);
              }
              XAException xae = new XAException(XAException.XAER_RMFAIL);
              xae.initCause(e);
              if (isTracingEnabled && tc.isEntryEnabled())
                  Tr.exit(this, tc, "end", xae);
              throw xae;
          }
  
          if (isTracingEnabled && tc.isEntryEnabled())
              Tr.exit(this, tc, "end");
      }