Close the DBService for the given tenant, if is has been cached. This is called
when a tenant is deleted.

@param tenant    {@link Tenant} being deleted.
166991
public void deleteTenantDB(Tenant tenant) {
        synchronized (m_tenantDBMap) {
            DBService dbservice = m_tenantDBMap.remove(tenant.getName());
            if (dbservice != null) {
                m_logger.info("Stopping DBService for deleted tenant: {}", tenant.getName());
                dbservice.stop();
            }
        }
    }
1260445
@Override
  public void close() throws IOException {
    try {
      if (closed) {
        IOException e = lastException;
        if (e == null)
          return;
        else
          throw e;
      }

      try {
        closeInternal();

        if (s != null) {
          for (int i = 0; i < s.length; i++) {
            s[i].close();
          }
          s = null;
        }
      } catch (IOException e) {
        lastException = e;
        throw e;
      }
      if (profileData != null && profileData.isAutoPrintWhileClose()) {
        DFSClient.LOG.info("Write Profile for " + this.src + ":"
            + profileData.toString());
      }
    } finally {
      // We always try to remove the connection from the lease to
      // avoid memory leak. In case of failed close(), it is possible
      // that later users' retry of close() could succeed but fail on
      // lease expiration. Since clients don't possibly write more data
      // after calling close(), this case doesn't change any guarantee
      // of data itself.
      dfsClient.leasechecker.remove(src);
    }
  }
814405
public void close()
    {
        super.close();  // Do any inherrited
        try   {
            if (m_JDBCConnection != null)
                m_JDBCConnection.close();
        } catch (SQLException ex) {
                // Ignore error
        }
        m_JDBCConnection = null;
    }
728791
@Override
	public void tearDownOperation() throws SQLException {
		Statement statement = null;

		try {
		    Connection connection = getConnection();
		    
			statement = connection.createStatement();
			

			disableReferentialIntegrity(statement);
			List<String> tableNames = getTableNames(getConnection());

			deleteContent(tableNames, statement);

		} catch (SQLException e) {
			LOG.error(e.getMessage(), e);
			try {
				rollback();
			} catch (SQLException e1) {
				LOG.error(e1.getMessage(), e1);
			}
		} finally {
			try {
				enableReferentialIntegrity(statement);

				if (statement != null) {
					statement.close();
				}
				commit();

				closeConnection();
			} catch (Exception e) {
			    rollback();
				LOG.error(e.getMessage(), e);
			}
		}

	}
1231484
public void close() {
        boolean isPreviouslyClosed = isClosed.getAndSet(true);
        if (isPreviouslyClosed) {
            return;
        }

        AdminClient client;
        while ((client = clientCache.poll()) != null) {
            client.close();
        }
    }
871949
public void close() throws SFException, SnowflakeSQLException
  {
    logger.debug(" public void close()");

    // stop heartbeat for this session
    stopHeartbeatForThisSession();

    if (isClosed)
    {
      return;
    }

    SessionUtil.LoginInput loginInput = new SessionUtil.LoginInput();
    loginInput.setServerUrl(
        (String) connectionPropertiesMap.get(SFSessionProperty.SERVER_URL))
        .setSessionToken(sessionToken)
        .setLoginTimeout(loginTimeout);

    SessionUtil.closeSession(loginInput);
    closeTelemetryClient();
    clientInfo.clear();
    isClosed = true;
  }
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);
			}
		}
	}
945451
public void close() {
    if (pool != null)
      pool.close();

    pool = null;
    if (shouldCloseOrientDB) {
      factory.close();
    }
  }
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);
		}
	}
1101050
@Override
    public void close() throws SQLException
    {
        try
        {
            isClosed = true;
            JDBC4ClientConnectionPool.dispose(NativeConnection);
        }
        catch(Exception x)
        {
            throw SQLError.get(x);
        }
    }
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;
  }
1050703
@Override
	public void close() {

		synchronized (lock) {

			closed = true;

			while (leaseCount > 0) {

				try {
					lock.wait();
				} catch (InterruptedException ignore) {
					// Even on interruption, we cannot terminate the loop until all open leases are closed.
				}
			}
		}
	}
542802
@POST
    @Path("close")    
    public void close(String id) {
    	Connection connection = ConnectionHolder.get().get(id);
    	try {
			connection.close();
			ConnectionHolder.get().remove(id);
		} catch (SQLException e) {
			// TODO
			throw new RuntimeException(e);
		}		
    }
829149
public static void close() {
        if (storedClient == null) {
            return;
        }

        storedClient.closeConnection();
        storedClient = null;

        // Allow the client to be auto initialized on the next use.
        autoInitAttempted.set(false);
    }
539159
@Override
    public void close() {
        if (!this.closed.get()) {
            Futures.await(Services.stopAsync(this, this.executor));
            log.info("{}: Closed.", this.traceObjectId);
            this.closed.set(true);
        }
    }
445225
public void close(boolean closeConnection) throws SQLException {
        if (closeConnection) {
            resultSet.getStatement().getConnection().close();
        } else {
            resultSet.close();
        }

        finished = true;
    }
420764
public void close() {
		if (dbEnv != null) {
			// closing dbs
			iidToIdDB.close();
			idToIidDB.close();
			if (useGeolocation) {
				iidToGeolocationDB.close();
			}
			if (useMetaData) {
				iidToMetadataDB.close();
			}
			closeInternal();
			dbEnv.close(); // closing env
		} else {
			System.out.println("BDB environment is null!");
		}
	}