Q. Which statement is correct about the EntityManager API? (Solved)

1. The merge, persist, remove, and getReference methods must be invoked within a transaction context.

2. It is safe (no exception is thrown) to call merge or getTransaction on a JTA EntityManager instance.

3. The getReference method can throw an EntityNotFoundException.

4. Runtime exceptions thrown by the refresh and createQuery methods of the EntityManager interface do NOT cause the transaction to be rolled back.

  • c. The getReference method can throw an EntityNotFoundException.
Subscribe Now

Get All Updates & News