How does the UserTransaction and the EntityManager interact?
问题 This is an academic question; I have no broken code in relation to this. I just want to expand my understanding of what is happening under the hood. The code pattern I have been using (copied from books and tutorials) in my JPA DAO for my typical JSF web applications is basically this: public class someDAO { @PersistenceContext protected EntityManager em; @Resource private UserTransaction utx; public void persist(Entity entity) { try { utx.begin(); em.persist(entity); utx.commit(); } catch (