code: private boolean checkForActiveConnections(int value) {
          /*
           * Check for active connections in the SharedPool
           */
          boolean activeConnections = false;
  
          /*
           * We have active connections or active pool requests if active requests
           * > 0 or the pool state is not = 1. In either case, we will consider the
           * pool active if statement is true.
           */
          if (value == 0) {
              mcToMCWMapWrite.lock();
              try {
                  Collection<MCWrapper> mcWrappers = mcToMCWMap.values();
                  Iterator<MCWrapper> mcWrapperIt = mcWrappers.iterator();
                  while (mcWrapperIt.hasNext()) {
                      MCWrapper mcw = mcWrapperIt.next();
                      /*
                       * We have atleast one active connection.
                       */
                      /*
                       * If the value is zero, both tests are used.
                       */
                      if (activeRequest.get() > 0) {
                          activeConnections = true;
                          break;
                      } else {
                          int poolState = mcw.getPoolState();
                          if ((poolState != 1) && (poolState != 9)) {
                              activeConnections = true;
                              break;
                          }
                      }
                  }
              } finally {
                  mcToMCWMapWrite.unlock();
              }
          } else {
              /*
               * Only activeRequest is used.
               */
              if (activeRequest.get() > 0) {
                  activeConnections = true;
              }
          }
  
          return activeConnections;
      }
docs: Look for active connection requests and connections
  in the shared and un-shared pools.
  
  @param value
  @return