Close the connection
@param boolean $realClose whether to shutdown the connection, default is added to the pool for next request.
169407
public function close($realClose = false)
    {
        $this->arg = null;
        $this->flag &= ~self::FLAG_BUSY;
        if ($realClose === true) {
            Client::debug('close conn \'', $this->conn, '\': ', $this->sock);
            $this->flag &= ~self::FLAG_OPENED;
            @fclose($this->sock);
            $this->delSockRef();
            $this->sock = false;
        } else {
            Client::debug('free conn \'', $this->conn, '\': ', $this->sock);
        }
    }
375922
public function closeConnection()
    {
        // release statement and close connection(s)
        $this->last_result = null;
        foreach ($this->dbhs as $dbh) {
            oci_close($dbh);
        }

        parent::closeConnection();
    }
59868
public synchronized void close(final boolean forceClose) throws SQLException {
        Collection<SQLException> exceptions = new LinkedList<>();
        MasterVisitedManager.clear();
        exceptions.addAll(closeResultSets());
        exceptions.addAll(closeStatements());
        if (!stateHandler.isInTransaction() || forceClose) {
            exceptions.addAll(releaseConnections(forceClose));
        }
        stateHandler.doNotifyIfNecessary();
        throwSQLExceptionIfNecessary(exceptions);
    }
133929
protected function close()
    {
        if (is_resource($this->stream)) {
            $this->flush();
            fclose($this->stream);
        }
        $this->stream = false;
    }
944452
@Override
    public boolean close () throws CIFSException {
        boolean inUse = false;
        
        List<SmbTransportImpl> toClose;
        synchronized ( this.connections ) {
            log.debug("Closing pool");
            toClose = new LinkedList<>(this.connections);
            toClose.addAll(this.nonPooledConnections);
            this.connections.clear();
            this.nonPooledConnections.clear();
        }
        for ( SmbTransportImpl conn : toClose ) {
            try {
                inUse |= conn.disconnect(false, false);
            }
            catch ( IOException e ) {
                log.warn("Failed to close connection", e);
            }
        }
        return inUse;
    }
1076731
function _close()
	{
		if (!$this->_connectionID) {
			return;
		}


		if (!$this->autoCommit) {
			oci_rollback($this->_connectionID);
		}
		if (count($this->_refLOBs) > 0) {
			foreach ($this ->_refLOBs as $key => $value) {
				$this->_refLOBs[$key]['LOB']->free();
				unset($this->_refLOBs[$key]);
			}
		}
		oci_close($this->_connectionID);

		$this->_stmt = false;
		$this->_connectionID = false;
	}
1127360
public void close() {
        synchronized (sessions) {
            closed = true;
            sessionCleaner.close();
            sessions.stream().forEach(PooledSession::reallyClose);
        }
    }
781979
public function disconnect($quit = true)
    {

        if ($quit) {
            $this->quit();
        }

        if ($this->isConnect()) {

            fclose($this->socket);
        }

        $this->host = null;
        $this->resetState();
    }
74037
function close()
    {
        $this->flush();
        $this->_opened = false;
        if ($this->_closeResource === true && is_resource($this->_stream)) {
            fclose($this->_stream);
        }
        return true;
    }
411990
function _close()
	{
		$this->lastQuery = false;
		if($this->_connectionID) {
			return ifx_close($this->_connectionID);
		}
		return true;
	}
1367263
void closeConnection(final PoolEntry poolEntry, final String closureReason)
   {
      if (connectionBag.remove(poolEntry)) {
         final Connection connection = poolEntry.close();
         closeConnectionExecutor.execute(() -> {
            quietlyCloseConnection(connection, closureReason);
            if (poolState == POOL_NORMAL) {
               fillPool();
            }
         });
      }
   }
227941
final void forceRealClose(ForceRealClosePolicy policy) {

      if(conn != null) {

         //Set transaction state to closed so app's close (in finally, hopefully) will do nothing when called.

         transactionState = TransactionState.CLOSED;

         if(policy == ForceRealClosePolicy.STATEMENTS_AND_CONNECTION) {
            for(Statement stmt : openStatements) {
               try {
                  stmt.close();
               } catch(SQLException se) {
                  //Ignore
               }
            }
         }

         if(policy != ForceRealClosePolicy.NONE) {
            if(policy == ForceRealClosePolicy.CONNECTION_WITH_LIMIT) {
               try {
                  closeTimeLimiter.callWithTimeout(new Callable<Boolean>() {
                     public Boolean call() throws Exception {
                        conn.close();
                        return Boolean.TRUE;
                     }
                  }, closeTimeLimitMillis, TimeUnit.MILLISECONDS);
               } catch(UncheckedTimeoutException ute) {
                  segment.logError("Unable to close connection after waiting " + closeTimeLimitMillis + " ms");
               } catch(Exception e) {
                  segment.logError("Connection close error", e);
               }
            } else {
               try {
                  conn.close();
               } catch(Exception e) {
                  segment.logError("Connection close error", e);
               }
            }
         }

         conn = null;
         realOpenTime = Long.MAX_VALUE;
         reopenAttempts = 0;
         lastTrace = null;
      }
   }
645067
protected function closeSlave($slave)
    {
        $slave->close();
        $this->slaves->remove($slave);

        if (!empty($slave->getConnection())) {
            /** @var ConnectionInterface */
            $connection = $slave->getConnection();
            $connection->removeAllListeners('close');
            $connection->close();
        }
    }
1345059
public function close(?string $connection = null): void
	{
		$connection = $connection ?? $this->default;

		if(isset($this->connections[$connection]))
		{
			if(method_exists($this->connections[$connection], 'close'))
			{
				// Call close on the connection object in case there's a reference
				// to the connection that won't be garbage collected immediately

				$this->connections[$connection]->close();
			}

			unset($this->connections[$connection]);
		}
	}
1326514
def close(self):
        

        self.__decrement_connection_counter()
        if self.connection_count == 0:
            if self.dbfile == ":memory:":
                SQL = """DROP TABLE IF EXISTS __self__"""
                self.sql(SQL, asrecarray=False, cache=False)
            else:
                self.connection.commit()
                self.connection.close()
1318236
public function close() {
		if ($this->redistype == 'redis')
			$this->connection->close();
		$this->connection = null;
		$this->verified_params = null;
	}
421098
public static function Close () {
		if (!static::GetStarted()) return;
		register_shutdown_function(function () {
			foreach (static::$instances as & $instance)
				if (count((array) $_SESSION[$instance->__name]) === 0)
					// if there is nothing in namespace - destroy it. It's useless.
					$instance->Destroy();
			$metaKey = static::SESSION_METADATA_KEY;
			$_SESSION[$metaKey] = serialize(static::$meta);
			@session_write_close();
		});
	}