close datasource
517040
public void close() {
        lock.lock();
        try {
            if (this.closed) {
                return;
            }

            if (!this.inited) {
                return;
            }

            if (logStatsThread != null) {
                logStatsThread.interrupt();
            }

            if (createConnectionThread != null) {
                createConnectionThread.interrupt();
            }

            if (destroyConnectionThread != null) {
                destroyConnectionThread.interrupt();
            }

            if (destroySchedulerFuture != null) {
                destroySchedulerFuture.cancel(true);
            }

            for (int i = 0; i < poolingCount; ++i) {
                try {
                    DruidConnectionHolder connHolder = connections[i];

                    for (PreparedStatementHolder stmtHolder : connHolder.getStatementPool().getMap().values()) {
                        connHolder.getStatementPool().closeRemovedStatement(stmtHolder);
                    }
                    connHolder.getStatementPool().getMap().clear();

                    Connection physicalConnection = connHolder.getConnection();
                    physicalConnection.close();
                    connections[i] = null;
                    destroyCount.incrementAndGet();
                } catch (Exception ex) {
                    LOG.warn("close connection error", ex);
                }
            }
            poolingCount = 0;

            // close elasticsearch client
            if (this.client != null) {
                this.client.close();
            }

            unregisterMbean();

            enable = false;
            notEmpty.signalAll();
            notEmptySignalCount++;

            this.closed = true;
            this.closeTimeMillis = System.currentTimeMillis();

            for (Filter filter : filters) {
                filter.destroy();
            }
        } finally {
            lock.unlock();
        }

        if (LOG.isInfoEnabled()) {
            LOG.info("{dataSource-" + this.getID() + "} closed");
        }
    }
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;
  }
140611
@SuppressWarnings("resource")
    @Override
    @Trivial
    public void close() throws ClassSource_Exception {
        String methodName = "close";
        if ( tc.isEntryEnabled() ) {
            Tr.entry(tc, methodName, getHashText());
        }

        JarFile useJarFile = getJarFile();
        if ( (opens < 0) ||
             ((opens == 0) && (useJarFile != null)) ||
             ((opens > 0) && (useJarFile == null)) ) {

            Tr.warning(tc, "ANNO_CLASSSOURCE_JAR_STATE_BAD", getHashText(), getJarPath(), Integer.valueOf(opens));

            opens = 0;
            useJarFile = clearJarFile();
            if ( useJarFile != null ) {
                try {
                    useJarFile.close(); // throws IOException
                } catch ( IOException e ) {
                    // defect 84235:we are generating multiple Warning/Error messages for each error due to each level reporting them.
                    // Disable the following warning and defer message generation to a higher level, 
                    // preferably the ultimate consumer of the exception.
                    //Tr.warning(tc, "ANNO_CLASSSOURCE_CLOSE5_EXCEPTION", getHashText(), getJarPath());

                    String eMsg = "[ " + getHashText() + " ] Failed to close [ " + getJarPath() + " ]";
                    throw getFactory().wrapIntoClassSourceException(CLASS_NAME, methodName, eMsg, e);
                }
            }

            String eMsg = "[ " + getHashText() + " ] Close with open count [ " + opens + " ]";
            throw getFactory().newClassSourceException(eMsg);
        }

        if ( --opens == 0 ) {
            useJarFile = clearJarFile();

            try {
                useJarFile.close(); // throws IOException
            } catch ( IOException e ) {
                // defect 84235:we are generating multiple Warning/Error messages for each error due to each level reporting them.
                // Disable the following warning and defer message generation to a higher level, 
                // preferably the ultimate consumer of the exception.
                //Tr.warning(tc, "ANNO_CLASSSOURCE_CLOSE5_EXCEPTION", getHashText(), getJarPath());

                String eMsg = "[ " + getHashText() + " ] Failed to close [ " + getJarPath() + " ]";
                throw getFactory().wrapIntoClassSourceException(CLASS_NAME, methodName, eMsg, e);
            }
        }

        if ( tc.isEntryEnabled() ) {
            Tr.exit(tc, methodName, getHashText());
        }
    }
1218574
public static void closeIfNecessary(Closeable closeable) throws ODataClientException {
        if (closeable != null) {
            try {
                closeable.close();
            } catch (IOException e) {
                throw new ODataClientException("Could not close '" + closeable.getClass().getSimpleName() + "'", e);
            }
        }
    }
1370055
protected void close() {
        guard.close();

        if (fd != null) {
            datagramSocketClose();
            ResourceManager.afterUdpClose();
            fd = null;
        }
    }
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;
  }
343384
@Override
	public void close()
    {
    	// Close filesystem
        try
        {
            if (allocationTableRandomAccessFile != null)
                allocationTableRandomAccessFile.close();
        }
        catch (IOException e)
        {
            log.error("["+descriptor.getName()+"] Could not close allocation table file : "+e.toString());
        }
        try
        {
            if (dataRandomAccessFile != null)
                dataRandomAccessFile.close();
        }
        catch (IOException e)
        {
            log.error("["+descriptor.getName()+"] Could not close map file : "+e.toString());
        }
    }
369778
private static void close(InputSource source) {
		if (source != null) {
			if (source.getByteStream() != null) {
				close(source.getByteStream());
			}
			if (source.getCharacterStream() != null) {
				close(source.getCharacterStream());
			}
		}
	}
533266
@Override
	public synchronized void close() {
		Set<IXADataRecorder> recoveredXADataRecorders = this.getRecoveredXADataRecorders();
		for (IXADataRecorder dataRecorder : recoveredXADataRecorders) {
			dataRecorder.disqualify();			
		}
	}
853303
def close_data(self):
        """"""
        # save the total number of cells to make re-loading convient
        if self.datafile is not None:
            if self.datafile.filemode != 'r':
                self.datafile.set_metadata('', {'total cells': self.current_cellid})
            self.datafile.close()
            self.datafile = None
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();
  }
709386
public void close() throws SQLException {
    if (!closed) {
      // flush any open output streams
      if (os != null) {
        try {
          // we can't call os.close() otherwise we go into an infinite loop!
          os.flush();
        } catch (IOException ioe) {
          throw new PSQLException("Exception flushing output stream", PSQLState.DATA_ERROR, ioe);
        } finally {
          os = null;
        }
      }

      // finally close
      FastpathArg[] args = new FastpathArg[1];
      args[0] = new FastpathArg(fd);
      fp.fastpath("lo_close", args); // true here as we dont care!!
      closed = true;
      if (this.commitOnClose) {
        this.conn.commit();
      }
    }
  }
789885
def database_close(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/close' % object_id, input_params, always_retry=always_retry, **kwargs)
1189756
@Override
	public void close() throws IOException {
		try {
			resultSet.close();
		} catch (SQLException se) {
			LOG.info("Inputformat couldn't be closed - " + se.getMessage());
		} catch (NullPointerException npe) {
		}
		try {
			statement.close();
		} catch (SQLException se) {
			LOG.info("Inputformat couldn't be closed - " + se.getMessage());
		} catch (NullPointerException npe) {
		}
		try {
			dbConn.close();
		} catch (SQLException se) {
			LOG.info("Inputformat couldn't be closed - " + se.getMessage());
		} catch (NullPointerException npe) {
		}
	}
149646
protected void closeDatagramChannel ()
    {
        if (_selector != null) {
            try {
                _selector.close();
            } catch (IOException ioe) {
                log.warning("Error closing selector: " + ioe);
            }
            _selector = null;
        }
        if (_datagramChannel != null) {
            log.debug("Closing datagram socket channel.");

            try {
                _datagramChannel.close();
            } catch (IOException ioe) {
                log.warning("Error closing datagram socket: " + ioe);
            }
            _datagramChannel = null;

            // clear these out because they are probably large and in charge
            _uout = null;
            _sequencer = null;
        }
    }
274541
void closeResultData() throws SQLException {

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

        if (generatedResultSet != null) {
            generatedResultSet.close();
        }
        generatedResultSet = null;
        generatedResult    = null;
        resultIn           = null;
    }
554599
public void close() throws DataUtilException {
        // render footer
        try {
            if(writer != null) {
                writeBottom(false);
            }
        } catch (IOException e) {
            throw new DataUtilException("Failed to close the HTML table file", e);
        }
    }