entity manager work