Hello
I am using JTA API for my application. Wanted to know a simple thing before starting the work. What is the better approach to obtaining a EntityManager in an EnterpriseBean.
Tech. no 1:
@PersistenceUnit
EntityManagerFactory emf;
EntityManager = emf.createEntityManager();
OR
Tech. no 2:
@PersistenceContext
EntityManager em;