コード例 #1
0
  public synchronized void syncClose() throws SQLException {
    if (this.disable) {
      return;
    }

    DruidConnectionHolder holder = this.holder;
    if (holder == null) {
      if (dupCloseLogEnable) {
        LOG.error("dup close");
      }
      return;
    }

    for (ConnectionEventListener listener : holder.getConnectionEventListeners()) {
      listener.connectionClosed(new ConnectionEvent(this));
    }

    DruidAbstractDataSource dataSource = holder.getDataSource();
    List<Filter> filters = dataSource.getProxyFilters();
    if (filters.size() > 0) {
      FilterChainImpl filterChain = new FilterChainImpl(dataSource);
      filterChain.dataSource_recycle(this);
    } else {
      recycle();
    }

    this.disable = true;
  }