exam questions

Exam 1z0-900 All Questions

View all questions & answers for the 1z0-900 exam

Exam 1z0-900 topic 1 question 64 discussion

Actual exam question from Oracle's 1z0-900
Question #: 64
Topic #: 1
[All 1z0-900 Questions]

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

  • A. LockModeType.PESSIMISTIC_READ is the synonym of LockModeType.READ
  • B. This operation will force serialization among transactions attempting to read the entity data.
  • C. This operation will result in a TransactionRolledbackException if the lock cannot be obtained.
  • D. If the application updates the entity later, and the changes are flushed to the database, the lock will be converted to an exclusive look.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
Reference:
https://docs.oracle.com/javaee/7/api/javax/persistence/LockModeType.html

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
maurytin
4 months, 3 weeks ago
D is the correct asnwer. JSR 338 JPA 2.1 page 95 of the specification: When an application locks an entity with LockModeType.PESSIMISTIC_READ and later updates that entity, the lock must be converted to an exclusive lock when the entity is flushed to the database[42].
upvoted 1 times
...
orjava
1 year ago
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.
upvoted 1 times
...
devmsaleh
2 years, 4 months ago
D is the correct answer
upvoted 2 times
...
emtchan
2 years, 10 months ago
The answer should be D.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago