OptimisticLockException « Exception « JPA Q&A





1. javax.persistence.OptimisticLockException + org.hibernate.StaleObjectStateException    stackoverflow.com

I'm catching javax.persistence.OptimisticLockException which works great, but I'm getting the stacktrace of StaleObjectStateException in my server log. I've checked and the getCause() on OptimisticLockException returns StaleObjectStateException, but why is it printed ...

2. OptimisticLockException and StaleObjectStateException    forum.hibernate.org

Hi all, I have a problem with OptimisticLockException and StaleObjectStateException in my application. Only happens recently. Below is the flow of entity manager usage during the transaction. Need your help to point out the mistake. Kinda stuck here.. ublic A print(A a) { B b = a.getB(); update (a); em.merge(b); em.flush(); a.setB(b); if (...) { a = issue(a); } return a; ...