Fix, entity manager can only be got from session.