docs: protected boolean forgetResource(JTAResource resource) {
          if (tc.isEntryEnabled())
              Tr.entry(tc, "forgetResource", resource);
  
          boolean result = false; // indicates whether retry necessary
          boolean auditing = false;
  
          try {
              boolean informResource = true;
  
              auditing = _transaction.auditSendForget(resource);
              if (xaFlowCallbackEnabled) {
                  informResource = XAFlowCallbackControl.beforeXAFlow(XAFlowCallback.FORGET,
                                                                      XAFlowCallback.FORGET_NORMAL);
              }
  
              if (informResource) {
                  resource.forget();
              }
  
              // Set the state of the Resource to completed after a successful forget.
              resource.setResourceStatus(StatefulResource.COMPLETED);
  
              if (auditing)
                  _transaction.auditForgetResponse(XAResource.XA_OK, resource);
              if (xaFlowCallbackEnabled) {
                  XAFlowCallbackControl.afterXAFlow(XAFlowCallback.FORGET,
                                                    XAFlowCallback.AFTER_SUCCESS);
              }
          } catch (XAException xae) {
              _errorCode = xae.errorCode; // Save locally for FFDC
              FFDCFilter.processException(xae, "com.ibm.tx.jta.impl.RegisteredResources.forgetResource", "2859", this);
              if (tc.isDebugEnabled())
                  Tr.debug(tc, "XAException: error code " + XAReturnCodeHelper.convertXACode(_errorCode), xae);
              if (auditing)
                  _transaction.auditForgetResponse(_errorCode, resource);
  
              if (xaFlowCallbackEnabled) {
                  XAFlowCallbackControl.afterXAFlow(XAFlowCallback.FORGET,
                                                    XAFlowCallback.AFTER_FAIL);
              }
  
              if (_errorCode == XAException.XAER_RMERR) {
                  // An internal error has occured within
                  // the resource manager and it was unable
                  // to forget the transaction.
                  //
                  // Retry the forget flow.
                  result = true;
                  addToFailedResources(resource);
              } else if (_errorCode == XAException.XAER_RMFAIL) {
                  // The resource manager is unavailable.
                  // Set the resource's state to failed so that
                  // we will attempt to reconnect to the resource
                  // manager upon retrying.
                  resource.setState(JTAResource.FAILED);
  
                  // Retry the forget flow.
                  result = true;
                  addToFailedResources(resource);
              } else if (_errorCode == XAException.XAER_NOTA) {
                  // The resource manager had no knowledge
                  // of this transaction. Perform some cleanup
                  // and return normally.
                  resource.setResourceStatus(StatefulResource.COMPLETED);
                  resource.destroy();
              } else // XAER_INVAL, XAER_PROTO
              {
                  if (!auditing)
                      Tr.error(tc, "WTRN0054_XA_FORGET_ERROR", new Object[] { XAReturnCodeHelper.convertXACode(_errorCode), xae });
  
                  resource.setResourceStatus(StatefulResource.COMPLETED);
  
                  // An internal logic error has occured.
                  _systemException = xae;
              }
          } catch (Throwable t) {
              // treat like RMERR
              FFDCFilter.processException(t, "com.ibm.tx.jta.impl.RegisteredResources.forgetResource", "2935", this);
              if (tc.isDebugEnabled())
                  Tr.debug(tc, "RuntimeException", t);
  
              if (xaFlowCallbackEnabled) {
                  XAFlowCallbackControl.afterXAFlow(XAFlowCallback.FORGET,
                                                    XAFlowCallback.AFTER_FAIL);
              }
  
              // An internal error has occured within
              // the resource manager and it was unable
              // to forget the transaction.
              //
              // Retry the forget flow.
              result = true;
              addToFailedResources(resource);
          }
  
          if (tc.isEntryEnabled())
              Tr.exit(tc, "forgetResource", result);
          return result;
      }