closes the connection an releases it to the pool

@param connection
320507
public void releaseConnection(IPhynixxManagedConnection<C> connection) {
        if (connection == null || !connection.hasCoreConnection()) {
            return;
        }
        try {
            //StringBuilder builder= new StringBuilder(Thread.currentThread().getId()+".releaseConnection starting from "+this.genericObjectPool.getNumIdle()+"/"+this.genericObjectPool.getNumActive());
            this.genericObjectPool.returnObject(connection);
            // LOG.debug(builder.append(" ... to "+Thread.currentThread().getId()+"   "+this.genericObjectPool.getNumIdle()+"/"+this.genericObjectPool.getNumActive()).toString());

        } catch (Exception e) {
            throw new DelegatedRuntimeException(e);
        }

        if (LOG.isDebugEnabled()) {
            LOG.debug("Proxy " + connection + " returned to Pool");
        }
    }
1068597
public void removeConnection (Connection connection) {
		if (connection == null) throw new IllegalArgumentException("connection cannot be null.");

		connection.removeListener(invokeListener);

		synchronized (connectionsLock) {
			ArrayList<Connection> temp = new ArrayList(Arrays.asList(connections));
			temp.remove(connection);
			connections = temp.toArray(new Connection[temp.size()]);
		}

		if (TRACE) trace("kryonet", "Removed connection from ObjectSpace: " + connection);
	}
906587
public static void closeQuietly(final Connection connection)
    {
        if (connection != null) {
            try {
                connection.close();
            }
            catch (JMSException je) {
                if (je.getCause() instanceof InterruptedException) {
                    LOG.trace("ActiveMQ caught and wrapped InterruptedException");
                }
                if (je.getCause() instanceof InterruptedIOException) {
                    LOG.trace("ActiveMQ caught and wrapped InterruptedIOException");
                }
                else {
                    LOG.warnDebug(je, "While closing connection");
                }
            }
        }
    }
174827
private void cleanConnectionClose(Connection connection, Statement stmt) {
        try {
            // clean close
            if (connection != null) {
                connection.rollback();
            }

            if (stmt != null) {
                stmt.close();
            }

            if (connection != null) {
                connection.close();
            }
        } catch (SQLException e1) {
            e1.printStackTrace();
        }
    }
2375
public static void closeQuietly(@Nullable Connection con) {
		try {
			close(con);
		} catch (SQLException e) {
			Loggers.get(Connections.class).log(SEVERE, "closing connection", e);
		}
	}
1193674
public void close() {
    synchronized (lock) {
      while (!available.isEmpty()) {
        PooledConnection pci = available.pop();
        try {
          pci.close();
        } catch (SQLException e) {
        }
      }
      available = null;
      while (!used.isEmpty()) {
        PooledConnection pci = used.pop();
        pci.removeConnectionEventListener(connectionEventListener);
        try {
          pci.close();
        } catch (SQLException e) {
        }
      }
      used = null;
    }
    removeStoredDataSource();
  }
1291057
public void closeConnection(String name) {
    final URI uri = uriWithPath("./connections/" + encodePathSegment(name));
    deleteIgnoring404(uri);
  }
503278
void quietlyCloseConnection(final Connection connection, final String closureReason)
   {
      if (connection != null) {
         try {
            logger.debug("{} - Closing connection {}: {}", poolName, connection, closureReason);

            try {
               setNetworkTimeout(connection, SECONDS.toMillis(15));
            }
            catch (SQLException e) {
               // ignore
            }
            finally {
               connection.close(); // continue with the close even if setNetworkTimeout() throws
            }
         }
         catch (Exception e) {
            logger.debug("{} - Closing connection {} failed", poolName, connection, e);
         }
      }
   }
318015
public static synchronized void closeCCMConnection(String poolName, Object mcp, Object cl,
                                                      Object connection, String key)
   {
      log.tracef("%s", new TraceEvent(poolName,
                                      Integer.toHexString(System.identityHashCode(mcp)),
                                      TraceEvent.CLOSE_CCM_CONNECTION,
                                      Integer.toHexString(System.identityHashCode(cl)),
                                      Integer.toHexString(System.identityHashCode(connection)),
                                      key));
   }
1030697
public static void closeConnection(Connection connection)
        throws InternalErrorException {

        if (connection != null) {
            try {
                connection.close();
            } catch (SQLException e) {
                throw new InternalErrorException(e);
            }
        }

    }
525473
protected void closeConnection(ThriftConnectionHandle<T> connection) {
		if (connection != null) {
			try {
				connection.internalClose();
			} catch (Throwable t) {
				logger.error("Destroy connection exception", t);
			} finally {
				this.thriftConnectionPool.postDestroyConnection(connection);
			}
		}
	}
1185683
protected void connectionClosed (Connection conn)
    {
        // remove this connection from our mappings (it is automatically removed from the Selector
        // when the socket is closed)
        _handlers.remove(conn.selkey);
        _connections.remove(conn.getConnectionId());
        _oflowqs.remove(conn);
        synchronized (this) {
            _stats.closes++;
        }
    }
420131
private function releaseToQueue(ConnectionInterface $connection)
    {
        if ($this->queue->count() < $this->poolConfig->getMaxActive()) {
            $this->queue->push($connection);
        }
    }
1089541
def close(self):
        """"""
        for cid in list(self.connections.keys()):
            self.remove(self.connections[cid].handle)
        LOGGER.debug('Pool %s closed', self.id)
1092497
public static void release(ResultSet result, Statement statement, Connection connection) {
        if (result != null) {
            try {
                result.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }

        if (statement != null) {
            try {
                statement.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }

        if (connection != null) {
            JDBCUtils.release(connection);
        }
    }
375922
public function closeConnection()
    {
        // release statement and close connection(s)
        $this->last_result = null;
        foreach ($this->dbhs as $dbh) {
            oci_close($dbh);
        }

        parent::closeConnection();
    }
148340
@Override
	public void close() {
		try {
			connection.close();
		} catch(IOException e) {
			log.log(Level.WARNING, "Could not close connection", e);
		}
	}