code: final boolean deactivate() throws InterruptedException {
  
        isActive = false; //Stop any reopen operations
        stats.deactivate();
  
        availableQueue.clear(); //No more open connections...
  
        reopenExecutor.getQueue().clear(); //Clear all active reopeners - don't care...
        
        //Wait for all open connections to be closed & connections in the process of closing to finish
        //Reopening connections don't matter
  
        long maxWaitMillis = activeTimeoutMillis;
        if(maxWaitMillis < 1L) {
           maxWaitMillis = 60000L;
        }
  
        long elapsedWaitMillis = 0L;
  
        outer:
        while(elapsedWaitMillis < maxWaitMillis) {
  
           for(ConnectionPoolConnection conn : connections) {
              int state = conn.state.get();
              if(state == ConnectionPoolConnection.STATE_OPEN ||
                      state == ConnectionPoolConnection.STATE_CLOSING) {
                 Thread.sleep(500L);
                 elapsedWaitMillis += 500L;
                 continue outer;
              } else {
                 conn.forceRealClose();
                 conn.state.set(ConnectionPoolConnection.STATE_DISCONNECTED);
              }
           }
  
           return true;
        }
  
        return false;
     }
docs: Deactivates the pool.
  <p>
  As connections are returned to the pool, the real
  database connections will be closed.
  </p>
  @return Were all connections deactivated?
  @throws InterruptedException if interrupted.