コード例 #1
0
  /** Closes all live connections. */
  private synchronized void closeAllConnections() {
    // close all underlying connections
    for (MySQLConnection c : this.liveConnections.values()) {
      try {
        this.activePhysicalConnections--;
        c.close();
      } catch (SQLException e) {
      }
    }

    if (!this.isClosed) {
      this.balancer.destroy();
      if (this.connectionGroup != null) {
        this.connectionGroup.closeConnectionProxy(this);
      }
    }

    this.liveConnections.clear();
    this.connectionsToHostsMap.clear();
  }
コード例 #2
0
 /**
  * Propagates the connection proxy down through all live connections.
  *
  * @param proxyConn The top level connection in the multi-host connections chain.
  */
 @Override
 protected void propagateProxyDown(MySQLConnection proxyConn) {
   for (MySQLConnection c : this.liveConnections.values()) {
     c.setProxy(proxyConn);
   }
 }