nerdexam
Oracle

1Z0-860 · Question #4

Given this Java EE application that uses a JTA application-managed entity manager: 20. UserTransaction utx = ...; 21. utx.beginQ; 22. // insert code here 23. utx.commitQ; Which two code fragments…

The correct answer is C. em.joinTransactionO; em.persist(order); D. em = emfcreateEntityManagerQ; em.persist(order). See the full explanation below for the reasoning.

Question

Given this Java EE application that uses a JTA application-managed entity manager: 20. UserTransaction utx = ...; 21. utx.beginQ; 22. // insert code here 23. utx.commitQ; Which two code fragments can be used on Line 22 to persist an order instance assuming that all references are properly initialized? (Choose two.

Options

  • Aem.merge(order); em.flushQ;
  • Bem.persist(order); em.flushO;
  • Cem.joinTransactionO; em.persist(order);
  • Dem = emfcreateEntityManagerQ; em.persist(order);

How the community answered

(35 responses)
  • A
    6% (2)
  • B
    11% (4)
  • C
    83% (29)

Community Discussion

No community discussion yet for this question.

Full 1Z0-860 Practice