Oracle
1Z0-860 · Question #300
A developer is modifying an existing Java EE application that uses the JDBC API to access a database. This code must be used but cannot be changed, and new code needs to be added that uses the Java…
The correct answer is B. Callflush at the end of each business method. See the full explanation below for the reasoning.
Question
A developer is modifying an existing Java EE application that uses the JDBC API to access a database. This code must be used but cannot be changed, and new code needs to be added that uses the Java Persistence API. Both parts of the code will execute in the same JTA transaction. Which method of the EntityManager interface should the new code use to ensure that the data read by JDBC statements includes the state of managed entities?
Options
- ACall refresh on each changed entity.
- BCallflush at the end of each business method.
- CCall find before accessing any managed entity.
- DCalllock at the beginning of each business method.
How the community answered
(29 responses)- A7% (2)
- B86% (25)
- C3% (1)
- D3% (1)
Community Discussion
No community discussion yet for this question.