Pass the db object through to subrequests