Page 1 of 1

About Question enthuware.oce-jpad.v6.2.369 :

Posted: Sat Dec 24, 2016 2:01 pm
by johnlong
As per section 3.4.4.2: 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.
How do you interpret "exclusive lock". Why it has to be exactly PESSIMISTIC_WRITE? Could it be PESSIMISTIC_FORCE_INCREMENT?

Re: About Question enthuware.oce-jpad.v6.2.369 :

Posted: Sun Dec 25, 2016 12:56 pm
by admin
Yes, it could be PESSIMISTIC_FORCE_INCREMENT as well, which is same as PESSIMISTIC_WRITE with version update.

Re: About Question enthuware.oce-jpad.v6.2.369 :

Posted: Sun Dec 25, 2016 6:31 pm
by johnlong
It could have similar semantics, but it has different definition. Thank you.

Re: About Question enthuware.oce-jpad.v6.2.369 :

Posted: Mon Aug 14, 2017 4:30 pm
by himaiMinh
For the second option explanation '.... without blocking other transactions reading the data".
I think we can modify this statement by adding " ...without blocking other transactions reading the data which was committed in a previous transaction."

When one transaction gets the pessimistic read lock, other transactions can read the entity's data in the database, but not the pending changes in the persistence context. After the transaction commits the changes to the database, other transactions need to refresh the entity.