Add locking module: optimistic vs pessimistic locking on Hibernate 7.4.14.Final
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YPgGH6aMbSLANL3E2HHmS6
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
same race, entity has @Version
|
||||
A: committed. B: failed
|
||||
B exception: jakarta.persistence.OptimisticLockException
|
||||
caused by: org.hibernate.StaleObjectStateException
|
||||
final balance: 110, version: 1
|
||||
|
||||
update statements Hibernate sent:
|
||||
update VersionedAccount set balance=?,owner=?,version=? where id=? and version=?
|
||||
update VersionedAccount set balance=?,owner=?,version=? where id=? and version=?
|
||||
Reference in New Issue
Block a user