docs: @Override
      public void commit(Xid xid, boolean onePhase) throws XAException {
  
          if (tc.isEntryEnabled()) {
              Tr.entry(this, tc, "commit");
          }
  
          /*
           *
           * if (this.xid != null && !xid.equals(this.xid)) {
           * final XAException e = new XAException(XAException.XAER_NOTA);
           * // What does this error really mean. Need to resolve
           * if (tc.isEventEnabled())
           * Tr.event(this, tc, "Error: Connection is already involved in different transaction.", e);
           * throw e;
           * }
           */
  
          if (!onePhase) {
              String xPath = null;
              if (mcWrapper != null) {
                  xPath = mcWrapper.gConfigProps.getXpathId();
              }
              Tr.error(tc, "XA_OP_NOT_SUPPORTED_J2CA0016", "commit", xid, xPath);
              XAException x = new XAException(XAException.XAER_PROTO);
              if (tc.isEntryEnabled()) {
                  Tr.exit(this, tc, "commit", x);
              }
              throw x;
          }
  
          boolean exceptionCaught = false;
          try {
              localTransaction.commit();
          } catch (Exception e) {
              com.ibm.ws.ffdc.FFDCFilter.processException(
                                                          e,
                                                          "com.ibm.ejs.j2c.LocalTransactionWrapper.commit",
                                                          "164",
                                                          this);
              if (!mcWrapper.shouldBeDestroyed()) {
                  mcWrapper.markTransactionError(); // Can't trust the connection since we don't know why it failed.
                  Tr.error(tc, "XA_END_EXCP_J2CA0024", "commit", xid, e, "XAException", mcWrapper.gConfigProps.getXpathId());
              }
              exceptionCaught = true;
              XAException xae = new XAException(XAException.XA_HEURHAZ);
              xae.initCause(e);
              if (tc.isEntryEnabled())
                  Tr.exit(this, tc, "commit", xae);
              throw xae;
          } finally {
              //this.xid = null;
              try {
                  if (registeredForSync == false) {
                      // Since we didn't register for synchronization for unshared/LTC/res-control=Application.
                      //  Instead of cleanup being done via after completion it will either happen at close or
                      //  commit/rollback which ever happens last.  This will allow the connection to be returned
                      //  to the pool prior to the end of the LTC scope allowing better utilization of the connection.
                      if (tc.isDebugEnabled()) {
                          Tr.debug(this, tc, "commit: calling afterCompletionCode() for cleanup");
                      }
                      afterCompletion(0);
                  }
              } catch (Exception e) {
                  if (tc.isDebugEnabled()) {
                      Tr.debug(this, tc, "commit: caught exception in finally block: ", e);
                  }
                  if (exceptionCaught == false) {
                      XAException xae = new XAException(XAException.XAER_RMFAIL);
                      xae.initCause(e);
                      if (tc.isEntryEnabled())
                          Tr.exit(this, tc, "commit", xae);
                      throw xae;
                  }
              }
          }
  
          if (tc.isEntryEnabled())
              Tr.exit(this, tc, "commit");
      }