Closes all databases that this factory instance previously created.

@throws EnvironmentFailureException if an unexpected, internal or
environment-wide failure occurs.
@throws IllegalStateException if the database has been closed.
486601
final void closeAndRemoveAllDatabaseHandles() {
        for (Database databaseHandle : this.databaseHandles) {
            try {
                databaseHandle.close();
            } catch (EnvironmentFailureException | IllegalStateException ex) {
                LOGGER.log(Level.SEVERE,
                        "Error closing databases", ex);
            }
        }
        this.databaseHandles.clear();
    }
1108245
public function closeConnection()
    {
        $this->db_connected = false;
        $this->db_index     = 0;

        // release statement and connection resources
        $this->last_result  = null;
        $this->dbh          = null;
        $this->dbhs         = array();
    }
414788
@Override
  public void close() {
    if (isClosed())
      return;

    vertexBaseClass = null;
    edgeBaseClass = null;

    checkOpeness();
    rollback();

    getMetadata().close();
    ((ODatabaseRaw) underlying.getUnderlying()).callOnCloseListeners();
    getLevel1Cache().clear();

    final OGraphDatabasePool pool = ownerPool;
    ownerPool = null;
    pool.release(this);
  }
357441
@PreDestroy
    public void close() {
        synchronized (operationOnConnectionMonitor) {
            if (state == State.CLOSED) {
                LOGGER.warn("Attempt to close connection factory which is already closed");
                return;
            }
            LOGGER.info("Closing connection factory");
            if (connection != null) {
                try {
                    connection.close();
                    connection = null;
                } catch (IOException e) {
                    if (! connection.isOpen()) {
                        LOGGER.warn("Attempt to close an already closed connection");
                    } else {
                        LOGGER.error("Unable to close current connection", e);
                    }
                }
            }
            changeState(State.CLOSED);
            LOGGER.info("Closed connection factory");
        }
    }
958665
public void closeAll() {
		for (Object connection : pool.values()) {
			JMXMonConnection jmxcon = (JMXMonConnection)connection;
            if (jmxcon.connector != null) {
                try {
                	jmxcon.connector.close();
                    log.debug("jmx connector is closed");
                } catch (Exception ex) {
                    log.debug("Can't close jmx connector, but continue");
                }
            } else {
                log.debug("jmxConnector == null, don't try to close connection");
            }
            
            jmxcon.connector = null;
            jmxcon = null;
            
        }
		/* erase pool informations for this run but will be recreate for the next run */
		pool.clear();
	}
746617
@JmxOperation(description = "Forcefully checkpoint all the environments")
    public void checkPointAllEnvironments() {
        synchronized(lock) {
            try {
                for(Environment environment: environments.values()) {
                    CheckpointConfig checkPointConfig = new CheckpointConfig();
                    checkPointConfig.setForce(true);
                    environment.checkpoint(checkPointConfig);
                }
            } catch(DatabaseException e) {
                throw new VoldemortException(e);
            }
        }
    }
813641
def close_db(self, exception):
        """"""
        if self.is_connected:
            if exception is None and not transaction.isDoomed():
                transaction.commit()
            else:
                transaction.abort()
            self.connection.close()
109478
@Override
	public void close() {
		IOUtils.closeQuietly(defaultColumnFamilyHandle);
		IOUtils.closeQuietly(nativeMetricMonitor);
		IOUtils.closeQuietly(db);
		// Making sure the already created column family options will be closed
		columnFamilyDescriptors.forEach((cfd) -> IOUtils.closeQuietly(cfd.getOptions()));
	}
598685
public void close() throws Exception {
        try {
            if (resultSet != null) {
                resultSet.close();
            }
        } finally {
            if (conn != null) {
                conn.close();
            }
        }
    }
782700
@Override
  public void close() {
    if (isClosed())
      return;

    checkOpeness();
    rollback();

    final OMetadata md = getMetadata();
    if (md != null)
      md.close();

    ((ODatabaseRaw) ((ODatabaseRecord) underlying).getUnderlying()).callOnCloseListeners();
    getLevel1Cache().clear();

    ownerPool.release(this);
    ownerPool = null;
  }
536933
public void closeAll(CmsDbContext dbc, Connection con, Statement stmnt, ResultSet res) {

        // NOTE: we have to close Connections/Statements that way, because a dbcp PoolablePreparedStatement
        // is not a DelegatedStatement; for that reason its not removed from the trace of the connection when it is closed.
        // So, the connection tries to close it again when the connection is closed itself;
        // as a result there is an error that forces the connection to be destroyed and not pooled

        if (dbc == null) {
            LOG.error(Messages.get().getBundle().key(Messages.LOG_NULL_DB_CONTEXT_0));
        }

        try {
            // first, close the result set
            if (res != null) {
                res.close();
            }
        } catch (SQLException e) {
            LOG.debug(e.getLocalizedMessage(), e);
        } finally {
            res = null;
        }

        try {
            // close the statement
            if (stmnt != null) {
                stmnt.close();
            }
        } catch (SQLException e) {
            LOG.debug(e.getLocalizedMessage(), e);
        } finally {
            stmnt = null;
        }

        try {
            // close the connection
            if ((con != null) && !con.isClosed()) {
                con.close();
            }
        } catch (SQLException e) {
            LOG.debug(e.getLocalizedMessage(), e);
        } finally {
            con = null;
        }

    }
1217778
@Override
  public void close() throws SQLException {
    if (queryExecutor == null) {
      // This might happen in case constructor throws an exception (e.g. host being not available).
      // When that happens the connection is still registered in the finalizer queue, so it gets finalized
      return;
    }
    releaseTimer();
    queryExecutor.close();
    openStackTrace = null;
  }
38791
@Override
  public void close() throws SQLException
  {
    logger.debug(" public void close()");

    if (isClosed)
    {
      // No exception is raised even if the connection is closed.
      return;
    }

    isClosed = true;
    try
    {
      if (sfSession != null)
      {
        sfSession.close();
        sfSession = null;
      }

      // make sure to close all created statements
      synchronized (openStatements)
      {
        for (Statement stmt : openStatements)
        {
          if (stmt != null && !stmt.isClosed())
          {
            if (stmt.isWrapperFor(SnowflakeStatementV1.class))
            {
              stmt.unwrap(SnowflakeStatementV1.class).close(false);
            }
            else
            {
              stmt.close();
            }
          }
        }
        openStatements.clear();
      }
    }
    catch (SFException ex)
    {
      throw new SnowflakeSQLException(
          ex.getCause(), ex.getSqlState(), ex.getVendorCode(), ex.getParams());
    }
  }
244821
@Override
	public void close(boolean compact, boolean cleanup) {
		logger.debug("close");
		super.close(compact, cleanup);
	    if (this.getDatabaseServer() == null) {
	    	return;
	    }
	    
	    try {
	        // shutdown
	    	((HsqldbDatabaseServer)this.getDatabaseServer()).shutdown(compact);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
        }
	}
343856
final void close() {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "close : " + ivArchivePuId, this);

        // First, prevent any further EntityManager factories from being
        // created. EMFs may be created for each java:comp/env context.
        if (ivEMFMap != null) {
            synchronized (ivEMFMap) {
                ivCreateEMFAllowed = false;
            }
        }

        // Next, shutdown any EntityManager pools that exist.  This will close
        // all of the pooled EMs and prevent the pools from adding any more EMs.
        // This does NOT close any EMs that customers may be actively using...
        // and it is also possible a new pool may be created prior to closing
        // the EMFs below, but the EMF close is gauranteed to close all EMs
        // associated with it.                                             d510184
        synchronized (ivEMPoolMap) {
            if (isTraceOn && tc.isDebugEnabled())
                Tr.debug(tc, "shutting down EM pools : " + ivEMPoolMap.size());

            for (JPAEMPool emPool : ivEMPoolMap.values()) {
                emPool.shutdown();
            }
        }

        unregisterClassFileTransformer(ivClassLoader);

        // Finally, close the base EMF, and any EMFs that have been created
        // for each java:comp/env.
        if (ivEMFactory != null) {
            // d455363 Begins
            if (ivEMFactory.isOpen()) {
                try {
                    if (isTraceOn && tc.isDebugEnabled())
                        Tr.debug(tc, "closing base EMF");
                    ivEMFactory.close();
                } catch (Exception e) {
                    FFDCFilter.processException(e, CLASS_NAME + ".close",
                                                "934", this);

                    if (isTraceOn && tc.isDebugEnabled())
                        Tr.debug(tc, "Caught unexpected exception on factory.close():" + e);
                }
            }
            // d455363 Ends

            // Close all of the factories for each J2EEName when the datasource
            // is defined in java:comp/env.                                 d510184
            if (ivEMFMap != null) {
                for (EntityManagerFactory emFactory : ivEMFMap.values()) {
                    if (emFactory.isOpen()) {
                        try {
                            if (isTraceOn && tc.isDebugEnabled())
                                Tr.debug(tc, "closing component EMF");
                            emFactory.close();
                        } catch (Exception e) {
                            FFDCFilter.processException(e, CLASS_NAME + ".close",
                                                        "934", this);

                            if (isTraceOn && tc.isDebugEnabled())
                                Tr.debug(tc, "Caught unexpected exception on factory.close():" + e);
                        }
                    }
                }
            }
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "close : " + ivArchivePuId);
    }
953497
protected void internalClose() throws SQLException {
		try {
			clearStatementCaches(true);
			if (this.connection != null){ // safety!
				this.connection.close();

				if (!this.connectionTrackingDisabled && this.finalizableRefs != null){
					this.finalizableRefs.remove(this.connection);
				}
			}
			this.logicallyClosed.set(true);
		} catch (SQLException e) {
			throw markPossiblyBroken(e);
		}
	}
718593
@Override
  public void close() throws SQLException {
    super.close();
    if (connection == null || connection.pooledConnection == null
        || connection.pooledConnection.noStmtEventListeners()) {
      return;
    }
    connection.pooledConnection.fireStatementClosed(this);
    connection = null;
  }