Fixed the problem with creating a single entity manager across multiple requests.