docs: public void release(MCWrapper mcWrapper, Object affinity) throws ResourceException {
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
              Tr.entry(this, tc, "release", mcWrapper, affinity,
                       "Pool contents ==>", toString2(1));
          }
          if (((com.ibm.ejs.j2c.MCWrapper) mcWrapper).isAlreadyBeingReleased()) {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "AddingJMS - release - Already releasing managed connection " + mcWrapper);
              }
              if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
                  Tr.exit(this, tc, "release", new Object[] { mcWrapper.getManagedConnectionWithoutStateCheck(), "Pool contents ==>", this });
              }
              return;
          }
          ((com.ibm.ejs.j2c.MCWrapper) mcWrapper).setAlreadyBeingReleased(true);
          /*
           * Added for holding out connection request while
           * a free or shared pool is being updated
           */
          requestingAccessToPool();
  
          // start  thread local fast path...
          if (localConnection_ != null) {
              if (mcWrapper.getPoolState() == MCWrapper.ConnectionState_sharedTLSPool || mcWrapper.getPoolState() == MCWrapper.ConnectionState_unsharedTLSPool) {
                  if (mcWrapper.isDestroyState() || mcWrapper.isStale() || mcWrapper.hasFatalErrorNotificationOccurred(freePool[0].getFatalErrorNotificationTime())
                      || ((this.agedTimeout != -1)
                          && (mcWrapper.hasAgedTimedOut(this.agedTimeoutMillis)))) {
                      removeMCWFromTLS(mcWrapper);
                      return;
  
                  } else {
                      try {
                          if (waiterCount > 0) {
                              /*
                               * If we have waiters, its likely the max connections and tls settings are not correct.
                               * When we have waiters, we need to try and remove one connection from this thread local
                               * and send the mcw to the waiter queue. By sending the mcw to the waiter queue, this connection may be assigned
                               * to a different thread local.
                               */
                              synchronized (waiterFreePoolLock) {
                                  if ((waiterCount > 0) && (waiterCount > mcWrapperWaiterList.size())) {
                                      // there are requests waiting
                                      ArrayList<MCWrapper> mh = localConnection_.get();
                                      if (mh != null) {
                                          requestingAccessToTLSPool();
                                          // remove a mcw from this thread local.
                                          mh.remove(mcWrapper);
                                          tlsArrayLists.remove(mcWrapper);
                                          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                                              ((com.ibm.ejs.j2c.MCWrapper) mcWrapper).setThreadID(((com.ibm.ejs.j2c.MCWrapper) mcWrapper).getThreadID() + "-release-waiter-removed");
                                              Tr.debug(this, tc, "removed mcWrapper from thread local " + mcWrapper);
                                          }
                                          endingAccessToTLSPool();
                                      }
                                      ((com.ibm.ejs.j2c.MCWrapper) mcWrapper).tlsCleanup();
                                      mcWrapper.setSharedPoolCoordinator(null);
                                      mcWrapperWaiterList.add(mcWrapper);
                                      mcWrapper.setPoolState(MCWrapper.ConnectionState_waiterPool);
                                      // notify a waiter.
                                      waiterFreePoolLock.notify();
                                      activeRequest.decrementAndGet();
                                      ((com.ibm.ejs.j2c.MCWrapper) mcWrapper).setAlreadyBeingReleased(false);
                                      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                                          Tr.exit(this, tc, "release");
                                      return;
                                  }
                              } // end synchronized (waiterFreePoolLock)
                          }
                          mcWrapper.setSharedPoolCoordinator(null);
                          ((com.ibm.ejs.j2c.MCWrapper) mcWrapper).tlsCleanup();
                          /*
                           * Our goal is for this mcw to stay on this thread, but if needed, after
                           * switching the state to freeTLSPool, this mcwrapper can be removed from this
                           * threads thread local storage and added to a different thread local storage or be placed
                           * in the main pool of connections. This should be the only place in the code that we set the
                           * pool state to MCWrapper.ConnectionState_freeTLSPool.
                           */
                          mcWrapper.setPoolState(MCWrapper.ConnectionState_freeTLSPool);
                          activeRequest.decrementAndGet();
                          ((com.ibm.ejs.j2c.MCWrapper) mcWrapper).setAlreadyBeingReleased(false);
                          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
                              Tr.exit(this, tc, "release", new Object[] { mcWrapper.getManagedConnectionWithoutStateCheck(), "Pool contents ==>", this });
                          }
                          return;
                      } catch (ResourceException re) {
                          removeMCWFromTLS(mcWrapper);
                          return;
                      }
                  }
              }
              if (mcWrapper.getPoolState() == MCWrapper.ConnectionState_freeTLSPool) {
                  // Already released, do nothing.
                  ((com.ibm.ejs.j2c.MCWrapper) mcWrapper).setAlreadyBeingReleased(false);
                  activeRequest.decrementAndGet();
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
                      Tr.exit(this, tc, "release", new Object[] { mcWrapper.getManagedConnectionWithoutStateCheck(), "Pool contents ==>", this });
                  }
                  return;
              }
          }
          //  end  thread local fast path...
  
          if (mcWrapper.isInSharedPool()) {
              ((SharedPool) mcWrapper.getSharedPool()).removeSharedConnection(mcWrapper);
              mcWrapper.setSharedPoolCoordinator(null);
              mcWrapper.setSharedPool(null);
              mcWrapper.setInSharedPool(false);
          }
  
          // Check to see if the pool is disabled.
          if (!gConfigProps.connectionPoolingEnabled || (mcWrapper instanceof com.ibm.ejs.j2c.MCWrapper && ((com.ibm.ejs.j2c.MCWrapper) mcWrapper).isMCAborted())) {
              // The pool is disabled, cleanup and destroy the connection.
              // No pooling of connection is allowed
  
              // remove the mcw from the mcToMCWMap
              mcToMCWMapWrite.lock();
              try {
                  mcToMCWMap.remove(mcWrapper.getManagedConnectionWithoutStateCheck());
              } finally {
                  mcToMCWMapWrite.unlock();
              }
  
              try {
                  mcWrapper.cleanup();
              } catch (Exception exn1) {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      Tr.debug(this, tc, "MCWrapper cleanup failed, datasource: " + gConfigProps.cfName);
                  boolean aborted = mcWrapper.getManagedConnection() instanceof WSManagedConnection
                                    && ((WSManagedConnection) mcWrapper.getManagedConnection()).isAborted();
                  if (!aborted) {
                      com.ibm.ws.ffdc.FFDCFilter.processException(exn1, "com.ibm.ejs.j2c.poolmanager.PoolManager.release", "1131", this);
                  }
  
              }
              try {
                  mcWrapper.destroy();
              } catch (Exception exn2) {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      Tr.debug(this, tc, "MCWrapper destroy failed, datasource: " + gConfigProps.cfName);
                  com.ibm.ws.ffdc.FFDCFilter.processException(exn2, "com.ibm.ejs.j2c.poolmanager.PoolManager.release", "1144", this);
              }
              synchronized (waiterFreePoolLock) {
                  this.totalConnectionCount.decrementAndGet();
                  if (waiterCount > 0)
                      waiterFreePoolLock.notify();
              }
          } else {
              // Move the pooled connection from the inuse state to the FreePool
              if (!mcWrapper.isInSharedPool())
                  mcWrapper.setPoolState(0);
  
              int hashMapBucket = mcWrapper.getHashMapBucket();
              freePool[hashMapBucket].returnToFreePool(mcWrapper);
          }
  
          activeRequest.decrementAndGet();
  
          if (_quiesce) {
              /*
               * QuiesceIfPossible should be called for the first time in ConnectionFactoryDetailsImpl.stop()
               * at which point _quiesce will be set to true. At that time if there are no connections in the pool
               * the pool will be quiesced, otherwise we will try again each time a connection is returned to the
               * pool (here).
               */
              quiesceIfPossible();
          }
  
          ((com.ibm.ejs.j2c.MCWrapper) mcWrapper).setAlreadyBeingReleased(false);
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
              Tr.debug(this, tc, "released managed connection " + mcWrapper.getManagedConnectionWithoutStateCheck(),
                       "pool contents ==>", this);
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
              Tr.exit(this, tc, "release");
          }
      }