docs: public void purgePoolContents() throws ResourceException {
          if (tc.isEntryEnabled()) {
              Tr.entry(this, tc, "purgePoolContents", gConfigProps.cfName);
          }
          ArrayList<MCWrapper> destroyMCWrappeList = new ArrayList<MCWrapper>();
          synchronized (destroyMCWrapperListLock) {
              for (int j = 0; j < gConfigProps.getMaxFreePoolHashSize(); ++j) {
                  synchronized (freePool[j].freeConnectionLockObject) {
                      /*
                       * If a connection gets away, by setting fatalErrorNotificationTime will
                       * guaranty when the connection is returned to the free pool, it will be
                       */
                      freePool[j].incrementFatalErrorValue(j);
                      /*
                       * Move as many connections as we can in the free pool to the destroy list
                       */
                      if (freePool[j].mcWrapperList.size() > 0) {
                          //freePool[j][i].removeCleanupAndDestroyAllFreeConnections();
                          int mcWrapperListIndex = freePool[j].mcWrapperList.size() - 1;
                          for (int k = mcWrapperListIndex; k >= 0; --k) {
                              MCWrapper mcw = (MCWrapper) freePool[j].mcWrapperList.remove(k);
                              if (!mcw.isMarkedForPurgeDestruction()) {
                                  mcw.setPoolState(0);
                                  mcw.markForPurgeDestruction();
                                  destroyMCWrappeList.add(mcw);
                                  --freePool[j].numberOfConnectionsAssignedToThisFreePool;
                              }
                          }
                      }
                  } // end free lock
              } //end for j
          } //end syc for destroyMCWrapperListLock
          if (localConnection_ != null) {
              boolean purgeTLS = false;
              /*
               * We can purge connections in the connection pool if we are not in thread sensitive code.
               */
              updateToTLSPoolInProgress.set(true); // set to true for pausing pool.
              synchronized (updateToTLSPoolInProgressLockObject) {
                  try {
                      sleep(20);
                  } catch (InterruptedException e) {
                  }
                  if (activeTLSRequest.get() > 0) {
                      try {
                          sleep(100);
                      } catch (InterruptedException e) {
                      }
                      if (activeTLSRequest.get() > 0) {
                          // We can not purge tls
                          if (tc.isDebugEnabled()) {
                              Tr.debug(this, tc, "To many active requests to search tls, active request value is " + activeRequest.get());
                          }
                      } else {
                          purgeTLS = true;
                      }
                  } else {
                      purgeTLS = true;
                  }
                  if (purgeTLS) {
                      if (tc.isDebugEnabled()) {
                          Tr.debug(this, tc, "Searching tls for a connections to purge.");
                      }
                      Iterator<Entry<MCWrapper, ArrayList<MCWrapper>>> it = tlsArrayLists.entrySet().iterator();
                      while (it.hasNext()) {
                          Entry<MCWrapper, ArrayList<MCWrapper>> e = it.next();
                          MCWrapper mcw = e.getKey();
                          if (mcw.getPoolState() == MCWrapper.ConnectionState_freeTLSPool) {
                              ArrayList<MCWrapper> mh = e.getValue();
                              mh.remove(mcw);
                              tlsArrayLists.remove(mcw);
                              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                                  ((com.ibm.ejs.j2c.MCWrapper) mcw).setThreadID(((com.ibm.ejs.j2c.MCWrapper) mcw).getThreadID() + "-purge-removed");
                                  Tr.debug(this, tc, "removed mcWrapper from thread local " + mcw);
                              }
                              if (!mcw.isMarkedForPurgeDestruction()) {
                                  mcw.setPoolState(0);
                                  mcw.markForPurgeDestruction();
                                  destroyMCWrappeList.add(mcw);
                              }
                          }
                      }
                  }
                  updateToTLSPoolInProgress.set(false); // set to false for releasing pool.
                  updateToTLSPoolInProgressLockObject.notifyAll();
              }
          }
          /*
           * we need to cleanup and destroy connections in the local destroy list.
           */
          for (int i = 0; i < destroyMCWrappeList.size(); ++i) {
              MCWrapper mcw = destroyMCWrappeList.get(i);
              freePool[0].cleanupAndDestroyMCWrapper(mcw);
              this.totalConnectionCount.decrementAndGet();
          }
          if (tc.isEntryEnabled()) {
              Tr.exit(this, tc, "purgePoolContents");
          }
      }