docs: public void tlsCleanup() throws ResourceException {
  
          final boolean isTracingEnabled = TraceComponent.isAnyTracingEnabled();
  
          if (isTracingEnabled && tc.isEntryEnabled()) {
              Tr.entry(this, tc, "tlsCleanup");
          }
  
          this.initialRequestStackTrace = null;
          this.clearHandleList();
  
          // ease state checks for error cleanup code.    if ((state != STATE_ACTIVE_INUSE) && (state != STATE_ACTIVE_FREE)) {
          if ((state == STATE_NEW) || (state == STATE_INACTIVE)) {
              IllegalStateException e = new IllegalStateException("cleanup: illegal state exception. State = " + getStateString() + " MCW = " + mcWrapperObject_hexString);
              Object[] parms = new Object[] { "cleanup", e };
              Tr.error(tc, "ILLEGAL_STATE_EXCEPTION_J2CA0079", parms);
              throw e;
          }
  
          try {
              /*
               * DissociateConnection needs to be called before cleanup.
               *
               * Under the original implementation for smart handles, no
               * dissociateConnection was needed because it was cleaned up
               * during the cleanup call on the mc. Now with the new implementation
               * cleanup will not do the dissociateConnection. If a resource
               * adapter is a instanceof DissociatableManagedConnection, we
               * need to call the dissociateConnection
               *
               * Lazy Connection Association Optimization is the new name
               * for smart handles.
               */
              if (isTracingEnabled && tc.isDebugEnabled())
                  Tr.debug(this, tc,
                           "InstanceOf DissociatableManagedConnection is " + gConfigProps.isInstanceOfDissociatableManagedConnection() + " In ConnectionManager " + this.toString());
  
              if (gConfigProps.isInstanceOfDissociatableManagedConnection()) {
                  if (isTracingEnabled && tc.isDebugEnabled())
                      Tr.debug(this, tc, "Calling mc.dissociateConnections()");
                  ((DissociatableManagedConnection) mc).dissociateConnections();
                  if (isTracingEnabled && tc.isDebugEnabled())
                      Tr.debug(this, tc, "Returned from mc.dissociateConnections()");
              }
              if (mc != null && !aborted) {
                  mc.cleanup();
              } else if (tc.isDebugEnabled()) {
                  Tr.debug(this, tc, "mc is null, or mc is aborted, mc.cleanup() not called.", (mc == null));
              }
          } catch (ResourceException e) {
  
              String localMessage = e.getLocalizedMessage();
              if ((localMessage != null) && localMessage.equals("Skip logging for this failing connection")) {
                  /*
                   * If the resource adapter throws a resource exception with the skip logging text,
                   * log this path only when debug is enabled.
                   *
                   * The resource apdater does not want normal logging of this failed managed connection.
                   */
                  if (tc.isDebugEnabled()) {
                      Tr.debug(this, tc, "Connection failed, resource adapter requested skipping failure logging");
                  }
                  throw e;
              } else {
                  com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ejs.j2c.MCWrapper.cleanup", "706", this);
                  /*
                   * We are here means there is an error occured during MC cleanup.
                   * Lets not log a error message, when we clearly know we are attempting to
                   * cleanup a bad connection. At this stage the error message could be misleading.
                   */
                  if (!stale && !do_not_reuse_mcw) {
                      Object[] parms = new Object[] { "cleanup", "cleanup", mc, e, gConfigProps.cfName };
                      Tr.error(tc, "MCERROR_J2CA0081", parms);
                  } else {
                      if (isTracingEnabled && tc.isDebugEnabled())
                          Tr.debug(this, tc, "got a SCE when doing cleanup on the mc, { mc, e, pmiName}; is:", new Object[] { mc, e, gConfigProps.cfName });
                  }
                  throw e;
              }
  
          } catch (Exception e) {
  
              com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ejs.j2c.MCWrapper.cleanup", "712", this);
              ResourceException re = null;
              if (!stale && !do_not_reuse_mcw) {
                  Object[] parms = new Object[] { "cleanup", "cleanup", mc, e, gConfigProps.cfName };
                  Tr.error(tc, "MCERROR_J2CA0081", parms);
              } else {
                  if (isTracingEnabled && tc.isDebugEnabled()) {
                      Tr.debug(this, tc, "got a SCE when doing cleanup on the mc, { mc, e, pmiName}; is:", new Object[] { mc, e, gConfigProps.cfName });
                  }
              }
              re = new ResourceException("cleanup: Exception caught");
              re.initCause(e);
              throw re;
  
          } finally {
              if (mcConnectionCount != 0) {
                  for (int i = mcConnectionCount; i > 0; i--) { //couldn't this just be while(mcConnectionCount > 0)
                      decrementHandleCount();
                  }
              }
  
              // reset to STATE_ACTIVE state.
              //  remove  if(pm.unusedTimeoutEnabled){ //we only need to set the
              // unusedTimeStamp if unused timeout
              // is enabled.
              // we must unconditionally reset unusedTimeStamp here.
  
              unusedTimeStamp = java.lang.System.currentTimeMillis();
              switch (tranWrapperInUse) {
                  /*
                   * Cleanup on the tran wrapper. This is not cleanup for
                   * the mc.
                   */
                  case XATXWRAPPER:
                      xaTranWrapper.cleanup();
                      break;
  
                  case LOCALTXWRAPPER:
                      localTranWrapper.cleanup();
                      break;
  
                  case NOTXWRAPPER:
                      noTranWrapper.cleanup();
                      break;
  
                  case RRSGLOBALTXWRAPPER:
                      rrsGlobalTranWrapper.cleanup();
                      break;
  
                  case RRSLOCALTXWRAPPER:
                      rrsLocalTranWrapper.cleanup();
                      break;
  
                  default:
                      break;
  
              }
  
              mcConnectionCount = 0;
              cm = null;
  
              boolean isAlreadyFreeActive = false;
              if (state == STATE_ACTIVE_FREE) {
                  isAlreadyFreeActive = true;
              }
  
              state = STATE_ACTIVE_FREE;
              tranWrapperInUse = NONE;
              uowCoord = null;
              holdTimeStart = 0;
              holdStartTimeSet = false;
              // threadId = null; //  keep the thead info for tls connections
              // threadName = null; //  keep the thread name info for tls connections
              totalUseTime = 0;
              currentUseStartTime = 0;
              useStartTimeSet = false;
              totalHoldTime = 0;
              if (!isAlreadyFreeActive) {
                  isNotAlreadyFreeActive();
              }
          }
  
          if (isTracingEnabled && tc.isEntryEnabled()) {
              Tr.exit(this, tc, "tlsCleanup");
          }
  
      }