Move connecting to the database outside of the request object to the request handler.