title: What's the difference between PESSIMISTIC_READ and PESSIMISTIC_WRITE in JPA?
body: <p>I have read the article <a href="http://blogs.oracle.com/enterprisetechtips/entry/locking_and_concurrency_in_java" rel="noreferrer">Locking and Concurrency in Java Persistence 2.0</a>, and run the sample application. But I still can't realize the difference between <code>PESSIMISTIC_READ</code> and <code>PESSIMISTIC_WRITE</code>. I tried to modify the code, and where the code using <code>PESSIMISTIC_READ</code> and <code>PESSIMISTIC_WRITE</code> will have the same result that the SQL will invoked with <code>for update</code>.</p>