persistent: add a client context to the persistent_stat and track the db_id