Correct Answer: C
Explanation/Reference:
Setting a Pessimistic Lock
An entity object can be locked explicitly by the lock method:
em.lock(employee, LockModeType.PESSIMISTIC_WRITE);
The first argument is an entity object. The second argument is the requested lock mode.
A LockTimeoutException is thrown if the requested pessimistic lock cannot be granted:
* A PESSIMISTIC_READ lock request fails if another user (which is represented by another EntityManager instance) currently holds a PESSIMISTIC_WRITE lock on that database object.
* A PESSIMISTIC_WRITE lock request fails if another user currently holds either a PESSIMISTIC_WRITE lock or a PESSIMISTIC_READ lock on that database object.
Reference: Locking in JPA, Pessimistic Locking
http://www.objectdb.com/java/jpa/persistence/lock#Pessimistic_Locking_