Question 18:
Given the code fragments:
What code should you add to the body of the updateEmployee method in order to save pending changes to the database?
Answer options:
A. entityManager.merge(emp); B. Context. Ctx = new InitialContext(); UserTransaction utx = (UserTransaction)ctx.lookup("java:comp/UserTransaction"); utx.begin(); entityManager.merge(emp); utx.commit(); C. entityManager.lock(emp); EntityManager.merge(emp); D. entityManager.getTransaction().begin(); entityManager.merge(emp); entityManager.getTransaction().commit();