nerdexam
Oracle

1Z0-898 · Question #65

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

The correct answer is C. If the application later updates the entity, and the changes are flushed to the database, the lock. Lock ModePESSIMISTIC_READ: Immediately obtain a long-term read lock on the data to prevent the data from being modified or deleted. Other transactions may read the data while the lock is maintained, but may not modify or delete the data. The persistence provider is permitted to…

Advanced Topics

Question

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

Options

  • AThis operation will force serialization among transactions attempting to read the entity data.
  • BThis operation will result in a TransactionRolledbackException if the lock cannot be obtained.
  • CIf the application later updates the entity, and the changes are flushed to the database, the lock
  • DLockModeType. PESSIMISTIC_READ is the synonym of the LockModeType.READ.

How the community answered

(39 responses)
  • A
    10% (4)
  • B
    3% (1)
  • C
    85% (33)
  • D
    3% (1)

Explanation

Lock ModePESSIMISTIC_READ: Immediately obtain a long-term read lock on the data to prevent the data from being modified or deleted. Other transactions may read the data while the lock is maintained, but may not modify or delete the data. The persistence provider is permitted to obtain a database write lock when a read lock was requested, but not vice versa. Note: A lock with LockModeType.PESSIMISTIC_READ can be used to query data using repeatable-read semantics without the need to reread the data at the end of the transaction to obtain a lock, and without blocking other transactions reading the data. Not A: A lock with LockModeType.PESSIMISTIC_WRITE, but not withLockModeType.PESSIMISTIC_READ,can be obtained on an entity instance to force serialization among transactions attempting to update the entity data. Not B: If a pessimistic lock cannot be obtained on the database rows, and the failure to lock the data results in a transaction rollback, a PessimisticLockException is thrown. If a pessimistic lock cannot be obtained, but the locking failure doesn't result in a transaction rollback, a LockTimeoutException is thrown. Not D: Lock ModeREAD is asynonym for OPTIMISTIC. Exam Questions, Study Guides, Practice Tests. Lead the way to help you pass any IT Certification exams, 100% Pass Guaranteed or Full Refund. Especially Cisco, CompTIA, Citrix, EMC, HP, Oracle, VMware, Juniper, Check Point, LPI, Nortel, EXIN and so on. Our Slogan: First Test, First Pass. Help you to pass any IT Certification exams at the first try. You can reach us at any of the email addresses listed below. Any problems about IT certification or our products, you could rely upon us, we will give you satisfactory answers in 24 hours.

Topics

#pessimistic locking#LockModeType#PESSIMISTIC_READ#lock upgrade

Community Discussion

No community discussion yet for this question.

Full 1Z0-898 Practice