Oracle
1Z0-860 · Question #47
A business method of a stateless session bean with a transaction attribute REQUIRED executes a Java Persistence query on a container-managed persistence context. Under which two conditions can the…
The correct answer is A. The flush mode is NOT explicitly set. D. The flush mode on the persistence context is set to AUTO but is NOT specified for the Query object. See the full explanation below for the reasoning.
Question
A business method of a stateless session bean with a transaction attribute REQUIRED executes a Java Persistence query on a container-managed persistence context. Under which two conditions can the developer expect the persistence provider to ensure that all changes made to the persistence context in the transaction are visible to the processing of the query? (Choose two.)
Options
- AThe flush mode is NOT explicitly set.
- BThe flush mode on the Query object is set to COMMIT.
- CThe refresh method on the EntityManager is called.
- DThe flush mode on the persistence context is set to AUTO but is NOT specified for the Query object.
How the community answered
(23 responses)- A74% (17)
- B17% (4)
- C9% (2)
Community Discussion
No community discussion yet for this question.