Which is a valid way of injecting a container-managed transaction-scoped persistence context into an EJB 3.0 session…?

Which is a valid way of injecting a container-managed transaction-scoped persistence context into
an EJB 3.0 session bean assuming the application contains only one persistence unit?

Which is a valid way of injecting a container-managed transaction-scoped persistence context into
an EJB 3.0 session bean assuming the application contains only one persistence unit?

A.
@PersistenceUnit
public EntityManager em;

B.
@PersistenceContext
private EntityManager em;

C.
@TransactionManagement(TransactionManagementType.CONTAINER)
public EntityManager em;

D.
@Resource(name=”persistence/em”, authenticationType=AuthenticationType.CONTAINER)
protected EntityManager em;

Explanation:



Leave a Reply 0

Your email address will not be published. Required fields are marked *