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,7 @@
|
||||
5 tickets, all NEW. Worker A claims 2 and keeps its transaction open.
|
||||
Worker B claims 2 with SKIP LOCKED.
|
||||
A got tickets: [1, 2]
|
||||
B got tickets: [3, 4]
|
||||
|
||||
select statements B sent:
|
||||
select t1_0.id,t1_0.claimedBy,t1_0.status from Ticket t1_0 where t1_0.status='NEW' order by t1_0.id fetch first ? rows only for update skip locked
|
||||
Reference in New Issue
Block a user