Add bookmyshow module: seat booking with hold expiry and payment timeout, naive vs pessimistic vs optimistic inventories, race and deadlock demos, JDBC strategies on H2 (8 test classes, 8 transcripts)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b5YFRisPHrLBR2dRu9
This commit is contained in:
asmhatre
2026-11-17 01:03:44 +05:30
co-authored by Claude Sonnet 5.5
parent deb924febd
commit c57031aaeb
42 changed files with 2322 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
Happy path, one user at a time (show SH-1, 60 seats, hold TTL 5 minutes)
========================================================================
A1 at the start: AVAILABLE v0
startBooking(asha, A1+A2): BK-0001 PENDING_PAYMENT, Rs 440
A1 after the hold: HELD by BK-0001 until T+05:00 v1
A3 untouched: AVAILABLE v0
startBooking(ravi, A2+A3): refused (seats not available for show SH-1: [A2, A3])
A3 after ravi's refusal: AVAILABLE v0
pay(BK-0001): CONFIRMED, booking is CONFIRMED
A1 after payment: BOOKED by BK-0001 v2
seat summary: {AVAILABLE=58, BOOKED=2, HELD=0}
Same log produced by NaiveInventory, PessimisticInventory and OptimisticInventory: true