Ensure EntityManager is closed after every transaction