Closes the database connection and cleans up the temporary file.
424811
def Close(self):
    """"""
    self.schema = {}

    if self._is_open:
      self._database.close()
    self._database = None

    if os.path.exists(self._temp_db_file_path):
      try:
        os.remove(self._temp_db_file_path)
      except (OSError, IOError) as exception:
        logger.warning((
            'Unable to remove temporary copy: {0:s} of SQLite database: '
            '{1:s} with error: {2!s}').format(
                self._temp_db_file_path, self._filename, exception))

    self._temp_db_file_path = ''

    if os.path.exists(self._temp_wal_file_path):
      try:
        os.remove(self._temp_wal_file_path)
      except (OSError, IOError) as exception:
        logger.warning((
            'Unable to remove temporary copy: {0:s} of SQLite database: '
            '{1:s} with error: {2!s}').format(
                self._temp_wal_file_path, self._filename, exception))

    self._temp_wal_file_path = ''

    self._is_open = False
450643
public synchronized void close() {
        for (PreparedStatement ps : threadedPsMap.get().values()) {
            if (null != ps) {
                try {
                    ps.close();
                } catch (SQLException e) {
                    // swallowed
                }
            }
        }
        try {
            if (null != connection) {
                this.connection.close();
            }
        } catch (SQLException e) {
            // swallowed
        }
    }
242915
public void cleanup() {
        if (file != null && file.exists() && !file.delete()) {
            LOGGER.debug("Failed to delete first temporary file {}", file.toString());
            file.deleteOnExit();
        }
    }
1185791
public function cleanup()
  {
    // Has to be done, otherwise sqlite-file is locked on Windows-OS
    $this->PDO = null;
    $this->PreparedInsertStatement = null;

    unlink($this->sqlite_db_file);
  }
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();
    }
51100
public void close() throws IOException, QdbException {
		this.compoundRegistry.close();
		this.propertyRegistry.close();
		this.descriptorRegistry.close();
		this.modelRegistry.close();
		this.predictionRegistry.close();

		try {
			this.storage.close();
		} finally {
			this.storage = null;
		}

		try {
			if(this.tempDir != null){
				FileUtil.deleteTempDirectory(this.tempDir);
			}
		} finally {
			this.tempDir = null;
		}
	}
1199413
def close(self, silent=False):
        
        if not silent:
            saveme = get_input("Save database contents to '{}/'? (y, [n]) \n"
                               "To save elsewhere, run db.save() before closing. ".format(self.directory))
            if saveme.lower() == 'y':
                self.save()

            delete = get_input("Do you want to delete {0}? (y,[n]) \n"
                               "Don't worry, a new one will be generated if you run astrodb.Database('{1}') "
                               .format(self.dbpath, self.sqlpath))
            if delete.lower() == 'y':
                print("Deleting {}".format(self.dbpath))
                os.system("rm {}".format(self.dbpath))

        print('Closing connection')
        self.conn.close()
274153
public void close() {
        try {
            state = "CLOSING";
            if( connection != null ) {
                logger.warn("Connection not committed, rolling back.");
                rollback();
            }
            if( !events.empty() ) {
                state = "CLOSING EVENTS";
                do {
                    Execution exec = (Execution)events.pop();
                
                    try {
                        Stack<Execution> stack;
                        
                        exec.close();
                        stack = eventCache.get(exec.getClass().getName());
                        if( stack != null ) {
                            stack.push(exec);
                        }
                    }
                    catch( Throwable t ) {
                        logger.error(t.getMessage(), t);
                    }
                } while( !events.empty() );
            }
            state = "CLOSED";
        }
        finally {
            if (tracking) {
                transactions.remove(new Integer(transactionId));
            }
            events.clear();
            statements.clear();
            stackTrace = null;
        }
    }
1193282
def close(self):
        ''''''
        if self._save_filename:
            self._cookie_jar.save(
                self._save_filename,
                ignore_discard=self._keep_session_cookies
            )
1364451
def cleanup(self):
        

        self.log.debug("Cleaning up %s temporary directory" % self.tmp_dir)
        shutil.rmtree(self.tmp_dir, ignore_errors=True)
1289763
protected function close()
	{
		Yii::trace('Closing DB connection','system.db.CDbConnection');
		$this->_pdo=null;
		$this->_active=false;
		$this->_schema=null;
	}
624279
public function close()
    {
        if ($this->manager !== null) {
            Yii::trace('Closing MongoDB connection: ' . $this->dsn, __METHOD__);
            $this->manager = null;
            foreach ($this->_databases as $database) {
                $database->clearCollections();
            }
            $this->_databases = [];
        }
    }
765069
public void close() throws IOException {
        try {
            if (conn != null) conn.close();

            conn = null;
            mysqlInput = null;
            mysqlOutput = null;
        } catch (SQLException e) {
            logger.warn("Unable to close connection", e);
        }
    }
1156330
@Override
  public void close() {
    LOG.info("Closing " + this.getClass().getSimpleName());
    try (Connection conn = createConnection()) {
      JdbcWriterCommands commands = createJdbcWriterCommands(conn);
      if (!this.createdStagingTables.isEmpty()) {
        for (String stagingTable : this.createdStagingTables) {
          LOG.info("Dropping staging table " + this.createdStagingTables);
          commands.drop(database, stagingTable);
        }
      }

      if (this.userCreatedStagingTable != null) {
        LOG.info("Truncating staging table " + this.userCreatedStagingTable);
        commands.truncate(database, this.userCreatedStagingTable);
      }
    } catch (SQLException e) {
      throw new RuntimeException("Failed to close", e);
    }
  }
362025
protected void cleanupOnExit() {
        String threadName = "Shutdown Hook Deletion Thread for Temporary DB " + dataDir.toString();
        final DB db = this;
        Runtime.getRuntime().addShutdownHook(new Thread(threadName) {

            @Override
            public void run() {
                // ManagedProcess DestroyOnShutdown ProcessDestroyer does
                // something similar, but it shouldn't hurt to better be save
                // than sorry and do it again ourselves here as well.
                try {
                    // Shut up and don't log if it was already stop() before
                    if (mysqldProcess != null && mysqldProcess.isAlive()) {
                        logger.info("cleanupOnExit() ShutdownHook now stopping database");
                        db.stop();
                    }
                } catch (ManagedProcessException e) {
                    logger.warn("cleanupOnExit() ShutdownHook: An error occurred while stopping the database", e);
                }

                if (dataDir.exists() && (configuration.isDeletingTemporaryBaseAndDataDirsOnShutdown() && Util.isTemporaryDirectory(dataDir.getAbsolutePath()))) {
                    logger.info("cleanupOnExit() ShutdownHook quietly deleting temporary DB data directory: " + dataDir);
                    FileUtils.deleteQuietly(dataDir);
                }
                if (baseDir.exists() && (configuration.isDeletingTemporaryBaseAndDataDirsOnShutdown() && Util.isTemporaryDirectory(dataDir.getAbsolutePath()))) {
                    logger.info("cleanupOnExit() ShutdownHook quietly deleting temporary DB base directory: " + baseDir);
                    FileUtils.deleteQuietly(baseDir);
                }
            }
        });
    }
1040066
def _Close(self):
    """"""
    if self._database_object:
      self._database_object.Close()

    self._blob = None
    self._current_offset = 0
    self._size = 0
    self._table_name = None
230058
def close( self ):
        
        if self.db is not None:
            self.db.commit()
            self.db.close()
            self.db = None

        return