This is a potentially long-running loop, we don't want to overwrite changes in the DB that happened while this is running.