Which of the following is true?

An application creates a TypedQuery object to perform a query, and sets the query objects flush mode by calling setFlushMode (FlushModeType.commit). The query is executed within a transaction.
Which of the following is true?

An application creates a TypedQuery object to perform a query, and sets the query objects flush mode by calling setFlushMode (FlushModeType.commit). The query is executed within a transaction.
Which of the following is true?

A.
Updates to the database tables may occur anytime during the transaction associated with the query.

B.
Updates to the entities that can affect the outcome of the query cannot be flushed to the database until the transaction commits.

C.
Changes to the entities in this transaction cannot be flushed to the database until the transaction commits.

D.
setFlushMode cannot be called on a TypedQuery object.



Leave a Reply 6

Your email address will not be published. Required fields are marked *


Tommy_Croatia_ZGB

Tommy_Croatia_ZGB

Correct answer is A.

According to the JPA specification (3.8.7 Queries and Flush Mode):

If FlushModeType.COMMIT is set, the effect of updates made to entities in the persistence
context upon queries is unspecified.