Exam 1z0-900 All QuestionsBrowse all questions from this exam
Question 57

A Persistence application locks entity x with a LockModeType.PESSIMISTIC_READ lock type. Which statement is true?

    Correct Answer: C

    When an entity is locked with a LockModeType.PESSIMISTIC_READ lock type, it means that the lock prevents other transactions from acquiring a PESSIMISTIC_WRITE lock on the same entity but doesn't prevent them from reading it. If the lock cannot be obtained because another transaction already holds a lock on the entity, a TransactionRolledbackException is usually thrown to indicate that the transaction has been rolled back due to the lock conflict.

Discussion
devmsalehOption: D

D is the correct answer

emtchanOption: D

The answer should be D.

orjavaOption: D

Answer D. LockModeType.READ Synonymous with OPTIMISTIC. PESSIMISTIC_READ - locks the record with read lock state when you read the record. This prevents other transactions from changing the record, but still allows them to read it. PESSIMISTIC_WRITE - locks the record, preventing other transaction from reading and writing it.