What’s the difference between PESSIMISTIC_READ and PESSIMISTIC_WRITE in JPA?
The difference lies in locking mechanism. PESSIMISTIC_READ lock means that dirty reads and non-repeatable reads are impossible when you have such a lock. If data should be changed it’s required to obtain PESSIMISTIC_WRITE lock PESSIMISTIC_WRITE lock guarantees that besides dirty and non-repeatable reads are impossible you can update data without obtaining additional locks(and possible deadlocks … Read more