Closes the database, releasing lock.
495321
def close(self):
        
        super(LockingDatabase, self).close()
        if not self.readonly:
            self.release_lock()
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()
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)
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();
    }
1294396
def close(self):
        
        if self.lock_on_connect or self.locked:
            self.unlock()  # this refers to the config DB
        self._unlock_xml_agent()  # this refers to the XML agent
        if hasattr(self.device, 'remote_conn'):
            self.device.remote_conn.close()
807936
public void close() {
        if (transactionalBranch != null) {
            XATransactionalBranch<C> branch= this.transactionalBranch;
            this.release();
            branch.getManagedConnection().close();
        }

    }
763033
@InterfaceAudience.Public
    public void close() {
        synchronized (lockDatabases) {
            Log.d(Database.TAG, "Closing " + this);

            // Close all database:
            // Snapshot of the current open database to avoid concurrent modification as
            // the database will be forgotten (removed from the databases map) when it is closed:
            Database[] openDbs = databases.values().toArray(new Database[databases.size()]);
            for (Database database : openDbs)
                database.close();
            databases.clear();

            // Stop reachability:
            context.getNetworkReachabilityManager().stopListening();

            // Shutdown ScheduledExecutorService:
            if (workExecutor != null && !workExecutor.isShutdown())
                Utils.shutdownAndAwaitTermination(workExecutor);

            Log.d(Database.TAG, "Closed " + this);
        }
    }
126198
@Override
  public void close() throws SQLException {
    if (last != null) {
      last.close();
      if (!con.isClosed()) {
        if (!con.getAutoCommit()) {
          try {
            con.rollback();
          } catch (SQLException ignored) {
          }
        }
      }
    }
    try {
      con.close();
    } finally {
      con = null;
    }
  }
907373
@Override
  public void close() throws IOException {
    try {
      try {
        if (this.failed && this.conn != null) {
          this.conn.rollback();
        }
      } finally {
        if (this.conn != null) {
          this.conn.close();
        }
      }
    } catch (SQLException e) {
      throw new RuntimeException(e);
    }
  }
1054953
public void close()
    {
        super.close();  // Do any inherited
        try   {
            if (m_remoteDatabase != null)
            {
                synchronized (this.getSyncObject(m_remoteDatabase))
                {   // In case this is called from another task
                    m_remoteDatabase.close();
                }
            }
        } catch (RemoteException ex)    {
            Utility.getLogger().warning("Remote close error: " + ex.getMessage());
            ex.printStackTrace();
        }
    }
834357
public void close() throws SQLException {

        validate();

        try {
            this.connection.rollback();
            this.connection.clearWarnings();
            this.connectionDefaults.setDefaults(this.connection);
            this.connection.reset();
            fireCloseEvent();
        } catch (SQLException e) {
            fireSqlExceptionEvent(e);

            throw e;
        }
    }
794885
public void close() {
    for (Entry<String, OResourcePool<String, DB>> pool : pools.entrySet()) {
      for (DB db : pool.getValue().getResources()) {
        pool.getValue().close();
        try {
          OLogManager.instance().debug(this, "Closing pooled database '%s'...", db.getName());
          ((ODatabasePooled) db).forceClose();
          OLogManager.instance().debug(this, "OK", db.getName());
        } catch (Exception e) {
          OLogManager.instance().debug(this, "Error: %d", e.toString());
        }
      }
    }
  }
1176377
def release_lock(self, force=False):
        
        if self.readonly:
            raise exc.ReadOnlyDatabase()
        if self._locked or force:
            self.log.debug("Removing lock file: {0}".format(self.lockfile))
            if os.path.exists(self.lockfile):
                os.remove(self.lockfile)
                self._locked = False
        else:
            self.log.debug("Database not locked (not removing)")
702008
@SuppressWarnings("unchecked")
    public void close() {
        synchronized (documentStores) {
            DocumentStore ds = documentStores.remove(location);
            if (ds != null) {
                database.close();
                ((QueryImpl)query).close();
            }
            else {
                throw new IllegalStateException("DocumentStore "+location+" already closed");
            }
        }
        eventBus.post(new DocumentStoreClosed(databaseName));
    }
945451
public void close() {
    if (pool != null)
      pool.close();

    pool = null;
    if (shouldCloseOrientDB) {
      factory.close();
    }
  }
751336
public void close() throws SQLException {
    isClosed = true;
    if (!isEof) {
      lock.lock();
      try {
        while (!isEof) {
          dataSize = 0; //to avoid storing data
          readNextValue();
        }

      } catch (SQLException queryException) {
        throw ExceptionMapper.getException(queryException, null, this.statement, false);
      } catch (IOException ioe) {
        throw handleIoException(ioe);
      } finally {
        resetVariables();
        lock.unlock();
      }
    }
    resetVariables();

    //keep garbage easy
    for (int i = 0; i < data.length; i++) {
      data[i] = null;
    }

    if (statement != null) {
      statement.checkCloseOnCompletion(this);
      statement = null;
    }
  }
157813
@Override
    public void close() {
        if (this.closed.compareAndSet(false, true)) {
            RocksDB db = this.database.get();
            if (db != null) {
                db.close();
                this.database.set(null);
            }

            if (this.writeOptions != null) {
                this.writeOptions.close();
            }

            if (this.databaseOptions != null) {
                this.databaseOptions.close();
            }

            clear(false);
            log.info("{}: Closed.", this.logId);

            Consumer<String> callback = this.closeCallback;
            if (callback != null) {
                Callbacks.invokeSafely(callback, this.id, null);
            }
        }
    }