Releases the lock  (deletes the <dbname>.lock file) if it was acquired by this class or force is set to True.
        
        :param force: Whether to force releasing the lock (e.g. if it was not acquired during this session).
        :type force: bool

def release_lock(self, force=False):
        """
        Releases the lock  (deletes the <dbname>.lock file) if it was acquired by this class or force is set to True.
        
        :param force: Whether to force releasing the lock (e.g. if it was not acquired during this session).
        :type force: bool
        """
        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)")