'Removes any empty metadata values older than the timestamp using the
given database connection. This function will not call commit on the
conn, but will instead return True if the database needs committing.
This function was created as a worker to limit transactions and commits
from other related functions.
:param conn: Database connection to reclaim metadata within.
:param timestamp: Empty metadata items last updated before this
timestamp will be removed.
:returns: True if conn.commit() should be called'

def _reclaim(self, conn, timestamp):

    try:
        md = conn.execute(('SELECT    metadata    FROM    %s_stat' % self.db_type)).fetchone()[0]
        if md:
            md = json.loads(md)
            keys_to_delete = []
            for (key, (value, value_timestamp)) in md.items():
                if ((value == '') and (value_timestamp < timestamp)):
                    keys_to_delete.append(key)
            if keys_to_delete:
                for key in keys_to_delete:
                    del md[key]
                conn.execute(('UPDATE    %s_stat    SET    metadata    =    ?' % self.db_type), (json.dumps(md),))
                return True
    except sqlite3.OperationalError as err:
        if ('no    such    column:    metadata' not in str(err)):
            raise
    return False
