1Z0-898 · Question #11
It a Persistence application locks entity x with a pessimistic lock, which statement is true?
The correct answer is D. If a lock cannot be obtained, the Persistence provider must throw an exception. When the lock cannot be obtained, and the database locking failure results in transaction-level rollback, the provider must throw the PessimisticLockException and ensure that the JTA transaction or EntityTransaction has been marked for rollback.
Question
It a Persistence application locks entity x with a pessimistic lock, which statement is true?
Options
- APersistence provider can defer obtaining the lock until the next synchronization of an entity to the
- BA Persistenceprovider will obtain the lock when the entity is refreshed from the database.
- CA Persistence provider is not required to support the LockModeType. PESSIMISTIC_WRITE
- DIf a lock cannot be obtained, the Persistence provider must throw an exception.
How the community answered
(25 responses)- A4% (1)
- B8% (2)
- C12% (3)
- D76% (19)
Explanation
When the lock cannot be obtained, and the database locking failure results in transaction-level rollback, the provider must throw the PessimisticLockException and ensure that the JTA transaction or EntityTransaction has been marked for rollback.
Topics
Community Discussion
No community discussion yet for this question.