Remove this physical database owner.
@param pDatabaseOwner
@return
198432
public int removePDatabaseOwner(ThinPhysicalDatabaseOwner pDatabaseOwner, boolean bFreeIfEmpty)
    {
        m_setPDatabaseOwners.remove(pDatabaseOwner);
        if (bFreeIfEmpty)
            if (m_setPDatabaseOwners.size() == 0)
                if (m_htTableList.size() == 0)
        {
            this.free();
            return 0;
        }
        return m_setPDatabaseOwners.size();
    }
111368
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null)
        {
            if (m_fldValue1 != null)
                if (m_fldValue1.getRecord() != this.getOwner().getRecord())
                    m_fldValue1.addListener(new FieldRemoveBOnCloseHandler(this));      // Not same file, if target file closes, remove this listener!
            if (m_fldValue2 != null)
                if (m_fldValue2.getRecord() != this.getOwner().getRecord())
                if (m_fldValue2.getRecord() != m_fldValue1.getRecord())
                    m_fldValue2.addListener(new FieldRemoveBOnCloseHandler(this));      // Not same file, if target file closes, remove this listener!
        }
    }
874699
def delete(self, instance):
        
        
        #TODO: Really drop the database based on a policy set in `instance.parameters`.
        #
        #      We need :
        #      - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop    => default to retain)
        #      - to check that the database name `instance.get_dbname()` is not in use by another instance (shared database)
        #      - credential on the Atlas cluster `instance.get_cluster()` to drop the database
        #
        
        self.backend.storage.remove(instance)
        
        return DeprovisionServiceSpec(False, "done")
676768
public void removeLockedObjectOwner( String owner ) {

        try {
            if (this.owner != null) {
                int size = this.owner.length;
                for (int i = 0; i < size; i++) {
                    // check every owner if it is the requested one
                    if (this.owner[i].equals(owner)) {
                        // remove the owner
                        size -= 1;
                        String[] newLockedObjectOwner = new String[size];
                        for (int j = 0; j < size; j++) {
                            if (j < i) {
                                newLockedObjectOwner[j] = this.owner[j];
                            } else {
                                newLockedObjectOwner[j] = this.owner[j + 1];
                            }
                        }
                        this.owner = newLockedObjectOwner;

                    }
                }
                if (this.owner.length == 0) {
                    this.owner = null;
                }
            }
        } catch (ArrayIndexOutOfBoundsException e) {
            LOGGER.error(e, new TextI18n("LockedObject.removeLockedObjectOwner()"));
        }
    }
949936
public void removeLockedObjectOwner(String owner) {

        try {
            if (_owner != null) {
                int size = _owner.length;
                for (int i = 0; i < size; i++) {
                    // check every owner if it is the requested one
                    if (_owner[i].equals(owner)) {
                        // remove the owner
                        String[] newLockedObjectOwner = new String[size - 1];
                        for (int j = 0; j < (size - 1); j++) {
                            if (j < i) {
                                newLockedObjectOwner[j] = _owner[j];
                            } else {
                                newLockedObjectOwner[j] = _owner[j + 1];
                            }
                        }
                        _owner = newLockedObjectOwner;

                    }
                }
                if (_owner.length == 0) {
                    _owner = null;
                }
            }
        } catch (ArrayIndexOutOfBoundsException e) {
            System.out.println("LockedObject.removeLockedObjectOwner()");
            System.out.println(e.toString());
        }
    }
632976
def uninstall_pgpm_from_db(self):
        
        drop_schema_cascade_script = 'DROP SCHEMA {schema_name} CASCADE;'

        if self._conn.closed:
            self._conn = psycopg2.connect(self._connection_string, connection_factory=pgpm.lib.utils.db.MegaConnection)

        cur = self._conn.cursor()

        # get current user
        cur.execute(pgpm.lib.utils.db.SqlScriptsHelper.current_user_sql)
        current_user = cur.fetchone()[0]

        # check if current user is a super user
        cur.execute(pgpm.lib.utils.db.SqlScriptsHelper.is_superuser_sql)
        is_cur_superuser = cur.fetchone()[0]
        if not is_cur_superuser:
            self._logger.debug('User {0} is not a superuser. Only superuser can remove pgpm'
                               .format(current_user))
            sys.exit(1)

        self._logger.debug('Removing pgpm from DB by dropping schema {0}'.format(self._pgpm_schema_name))
        cur.execute(drop_schema_cascade_script.format(schema_name=self._pgpm_schema_name))

        # Commit transaction
        self._conn.commit()

        self._conn.close()

        return 0
879055
def remove(cls, name):
        

        client = Client.instance()

        new_current_database = None

        if client.database != name:
            new_current_database = name

        # Deletions are only possible from the system database
        client.set_database(name=SYSTEM_DATABASE)

        api = client.api
        api.database(name).delete()

        if new_current_database:
            client.set_database(name=new_current_database)
231367
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (this.getOwner() != null) if (!this.getOwner().isNull())
            // Display the screen that is supposed to be up now
            this.fieldChanged(DBConstants.DISPLAY, DBConstants.INIT_MOVE);
    }
102639
public static function removeOwner($owner_id, $owner, $owner_attribute)
    {
        $mediafiles = Owners::findOne([
            'owner_id' => $owner_id,
            'owner' => $owner,
            'owner_attribute' => $owner_attribute,
        ]);

        if ($mediafiles) {
            return $mediafiles->delete();
        }

        return false;
    }
816389
def remove():
    
    if exists(env.venv_path):
        run("rm -rf %s" % env.venv_path)
    if exists(env.proj_path):
        run("rm -rf %s" % env.proj_path)
    for template in get_templates().values():
        remote_path = template["remote_path"]
        if exists(remote_path):
            sudo("rm %s" % remote_path)
    if exists(env.repo_path):
        run("rm -rf %s" % env.repo_path)
    sudo("supervisorctl update")
    psql("DROP DATABASE IF EXISTS %s;" % env.proj_name)
    psql("DROP USER IF EXISTS %s;" % env.proj_name)
1276368
def delete_user(self, user):
        
        assert self.user == 'catroot' or self.user == 'postgres'
        assert not user == 'public'
        con = self.connection or self._connect()
        cur = con.cursor()
        cur.execute('DROP SCHEMA {user} CASCADE;'.format(user=user))
        cur.execute('REVOKE USAGE ON SCHEMA public FROM {user};'
                    .format(user=user))
        cur.execute(
            'REVOKE SELECT ON ALL TABLES IN SCHEMA public FROM {user};'
            .format(user=user))
        cur.execute(
            'DROP ROLE {user};'.format(user=user))
        self.stdout.write(
            'REMOVED USER {user}\n'.format(user=user))

        if self.connection is None:
            con.commit()
            con.close()

        return self
129403
@Override
    public ResponseEntity<Void> deleteTenant(@PathVariable("tenant") final String tenant) {
        systemManagement.deleteTenant(tenant);
        return ResponseEntity.ok().build();
    }
616399
public synchronized void unregister(final OStorage iStorage) {
		for (ODatabaseComplex<?> db : new HashSet<ODatabaseComplex<?>>(instances.keySet())) {
			if (db != null && db.getStorage() == iStorage) {
				db.close();
				instances.remove(db);
			}
		}
	}
241926
@Override
    public void setOwner(ApiBaseUser owner) {
        room.setOwner(CommandUtil.getSfsUser(owner, api));
        apiRoom.setOwner(owner);
    }
307624
public static void cleanup(MountOwner owner) {
        final Set<RegistryEntry> references = ownerReferences.remove(owner);
        if (references != null) {
            for (RegistryEntry entry : references) {
                entry.removeInboundReference(owner);
            }
        }
        owner.onCleanup();
    }
1181790
private void unregisterObject(DigitalObject obj)
            throws StorageDeviceException {
        String pid = obj.getPid();
        Connection conn = null;
        PreparedStatement st = null;
        try {
            conn = m_connectionPool.getReadWriteConnection();
            String query = "DELETE FROM doRegistry WHERE doPID=?";
            st = conn.prepareStatement(query);
            st.setString(1, pid);
            st.executeUpdate();

            //TODO hasModel
            if (obj.hasContentModel(Models.SERVICE_DEPLOYMENT_3_0)) {
                updateDeploymentMap(obj, conn, true);
            }
        } catch (SQLException sqle) {
            throw new StorageDeviceException(
                    "Unexpected error from SQL database while unregistering object: " +
                            sqle.getMessage(), sqle);
        } finally {
            try {
                if (st != null) {
                    st.close();
                }
                if (conn != null) {
                    m_connectionPool.free(conn);
                }
            } catch (Exception sqle) {
                throw new StorageDeviceException(
                        "Unexpected error from SQL database while unregistering object: " +
                                sqle.getMessage(), sqle);
            } finally {
                st = null;
            }
        }
    }
1354861
public function clearOwner()
    {
        if (empty($this->ownerStack)) {
            throw new BadMethodCallException("clearOwner() called more than setOwner()");
        }
        $this->owner = array_pop($this->ownerStack);
    }