openjdk version "21.0.11" 2026-04-21 LTS
OpenJDK Runtime Environment Corretto-21.0.11.10.1 (build 21.0.11+10-LTS)
OpenJDK 64-Bit Server VM Corretto-21.0.11.10.1 (build 21.0.11+10-LTS, mixed mode, sharing)
javac 21.0.11
PASS frozen source integrity ed5a420a0189945118b8b0211f6da39e989a453d 19
H2 version=2.1.214 SHA256=d623cdc0f61d218cf549a8d09f1c391ff91096116b22e2475475fce4fbe72bd0
OPEN connection=1 isolation=2
SQL connection=1 thread=main text=CREATE TABLE equipment (  tenant_id VARCHAR(40) NOT NULL,  equipment_id VARCHAR(80) NOT NULL,  category VARCHAR(80) NOT NULL,  state VARCHAR(30) NOT NULL CHECK (state IN ('ACTIVE','RETIRED','INSPECTION_REQUIRED')),  version BIGINT NOT NULL DEFAULT 0,  PRIMARY KEY(tenant_id,equipment_id) ) binds=[]
ROWS connection=1 affected=0
SQL connection=1 thread=main text=CREATE TABLE rental_contract (  tenant_id VARCHAR(40) NOT NULL,  contract_id VARCHAR(80) NOT NULL,  equipment_id VARCHAR(80) NOT NULL,  starts_at TIMESTAMP(9) WITH TIME ZONE NOT NULL,  ends_at TIMESTAMP(9) WITH TIME ZONE NOT NULL,  amount DECIMAL(19,2) NOT NULL CHECK (amount >= 0),  currency VARCHAR(3) NOT NULL CHECK (currency IN ('CNY','USD')),  status VARCHAR(16) NOT NULL CHECK (status IN ('RESERVED','CANCELLED')),  version BIGINT NOT NULL DEFAULT 0,  PRIMARY KEY(tenant_id,contract_id),  FOREIGN KEY(tenant_id,equipment_id) REFERENCES equipment(tenant_id,equipment_id),  CHECK (starts_at < ends_at) ) binds=[]
ROWS connection=1 affected=0
SQL connection=1 thread=main text=CREATE TABLE contract_line (  tenant_id VARCHAR(40) NOT NULL,  contract_id VARCHAR(80) NOT NULL,  line_no INT NOT NULL,  description VARCHAR(120) NOT NULL,  amount DECIMAL(19,2) NOT NULL CHECK (amount >= 0),  PRIMARY KEY(tenant_id,contract_id,line_no),  FOREIGN KEY(tenant_id,contract_id) REFERENCES rental_contract(tenant_id,contract_id) ) binds=[]
ROWS connection=1 affected=0
COMMIT connection=1 count=1
SQL connection=1 thread=main text=SELECT H2VERSION() binds=[]
DATABASE H2=2.1.214 schema=v1
CLOSE connection=1 openStatements=0
OPEN connection=2 isolation=2
SQL connection=2 thread=main text=DELETE FROM contract_line binds=[]
ROWS connection=2 affected=0
SQL connection=2 thread=main text=DELETE FROM rental_contract binds=[]
ROWS connection=2 affected=0
SQL connection=2 thread=main text=DELETE FROM equipment binds=[]
ROWS connection=2 affected=0
SQL connection=2 thread=main text=INSERT INTO equipment(tenant_id,equipment_id,category,state) VALUES('T1','E1','camera','ACTIVE') binds=[]
ROWS connection=2 affected=1
SQL connection=2 thread=main text=INSERT INTO rental_contract(tenant_id,contract_id,equipment_id,starts_at,ends_at,amount,currency,status,version) VALUES(?,?,?,?,?,?,?,?,?) binds=[T1, C1, E1, 2026-10-03T10:00:00.123456789Z, 2026-10-03T11:30:00.123456789Z, 25.00, CNY, RESERVED, 0]
ROWS connection=2 affected=1
COMMIT connection=2 count=1
CLOSE connection=2 openStatements=0
OPEN connection=3 isolation=2
OPEN connection=4 isolation=2
SQL connection=4 thread=pool-1-thread-2 text=SELECT * FROM rental_contract WHERE tenant_id=? AND contract_id=? binds=[T1, C1]
SQL connection=3 thread=pool-1-thread-1 text=SELECT * FROM rental_contract WHERE tenant_id=? AND contract_id=? binds=[T1, C1]
SQL connection=3 thread=pool-1-thread-1 text=UPDATE rental_contract SET amount=? WHERE tenant_id='T1' AND contract_id='C1' binds=[30.00]
ROWS connection=3 affected=1
COMMIT connection=3 count=1
CLOSE connection=3 openStatements=0
SQL connection=4 thread=pool-1-thread-2 text=UPDATE rental_contract SET amount=? WHERE tenant_id='T1' AND contract_id='C1' binds=[32.00]
ROWS connection=4 affected=1
COMMIT connection=4 count=1
CLOSE connection=4 openStatements=0
PASS money race uses independent connections optimistic=false
PASS actual update counts optimistic=false
MONEY_RACE optimistic=false first=Outcome[connection=3, affected=1, state=OK, millis=0] second=Outcome[connection=4, affected=1, state=OK, millis=0]
OPEN connection=5 isolation=2
SQL connection=5 thread=main text=SELECT amount FROM rental_contract WHERE contract_id='C1' binds=[]
CLOSE connection=5 openStatements=0
PASS unprotected stale read loses first increment
OPEN connection=6 isolation=2
SQL connection=6 thread=main text=DELETE FROM contract_line binds=[]
ROWS connection=6 affected=0
SQL connection=6 thread=main text=DELETE FROM rental_contract binds=[]
ROWS connection=6 affected=1
SQL connection=6 thread=main text=DELETE FROM equipment binds=[]
ROWS connection=6 affected=1
SQL connection=6 thread=main text=INSERT INTO equipment(tenant_id,equipment_id,category,state) VALUES('T1','E1','camera','ACTIVE') binds=[]
ROWS connection=6 affected=1
SQL connection=6 thread=main text=INSERT INTO rental_contract(tenant_id,contract_id,equipment_id,starts_at,ends_at,amount,currency,status,version) VALUES(?,?,?,?,?,?,?,?,?) binds=[T1, C1, E1, 2026-10-03T10:00:00.123456789Z, 2026-10-03T11:30:00.123456789Z, 25.00, CNY, RESERVED, 0]
ROWS connection=6 affected=1
COMMIT connection=6 count=1
CLOSE connection=6 openStatements=0
OPEN connection=7 isolation=2
SQL connection=7 thread=pool-2-thread-1 text=SELECT * FROM rental_contract WHERE tenant_id=? AND contract_id=? binds=[T1, C1]
OPEN connection=8 isolation=2
SQL connection=8 thread=pool-2-thread-2 text=SELECT * FROM rental_contract WHERE tenant_id=? AND contract_id=? binds=[T1, C1]
SQL connection=7 thread=pool-2-thread-1 text=UPDATE rental_contract SET amount=?,version=version+1 WHERE tenant_id='T1' AND contract_id='C1' AND version=? binds=[30.00, 0]
ROWS connection=7 affected=1
COMMIT connection=7 count=1
CLOSE connection=7 openStatements=0
SQL connection=8 thread=pool-2-thread-2 text=UPDATE rental_contract SET amount=?,version=version+1 WHERE tenant_id='T1' AND contract_id='C1' AND version=? binds=[32.00, 0]
ROWS connection=8 affected=0
ROLLBACK connection=8 count=1
CLOSE connection=8 openStatements=0
PASS money race uses independent connections optimistic=true
PASS actual update counts optimistic=true
MONEY_RACE optimistic=true first=Outcome[connection=7, affected=1, state=OK, millis=0] second=Outcome[connection=8, affected=0, state=VERSION_CONFLICT, millis=0]
OPEN connection=9 isolation=2
SQL connection=9 thread=main text=SELECT amount FROM rental_contract WHERE contract_id='C1' binds=[]
CLOSE connection=9 openStatements=0
PASS version predicate prevents stale overwrite
OPEN connection=10 isolation=2
SQL connection=10 thread=main text=SELECT * FROM rental_contract WHERE tenant_id=? AND contract_id=? binds=[T1, C1]
SQL connection=10 thread=main text=UPDATE rental_contract SET amount=?,version=version+1 WHERE tenant_id='T1' AND contract_id='C1' AND version=? binds=[37.00, 1]
ROWS connection=10 affected=1
PASS retry rereads version1 and succeeds once
COMMIT connection=10 count=1
CLOSE connection=10 openStatements=0
OPEN connection=11 isolation=2
SQL connection=11 thread=main text=SELECT amount FROM rental_contract WHERE contract_id='C1' binds=[]
CLOSE connection=11 openStatements=0
PASS retry preserves both accepted increments
OPEN connection=12 isolation=2
SQL connection=12 thread=main text=DELETE FROM contract_line binds=[]
ROWS connection=12 affected=0
SQL connection=12 thread=main text=DELETE FROM rental_contract binds=[]
ROWS connection=12 affected=1
SQL connection=12 thread=main text=DELETE FROM equipment binds=[]
ROWS connection=12 affected=1
SQL connection=12 thread=main text=INSERT INTO equipment(tenant_id,equipment_id,category,state) VALUES('T1','E1','camera','ACTIVE') binds=[]
ROWS connection=12 affected=1
COMMIT connection=12 count=1
CLOSE connection=12 openStatements=0
OPEN connection=13 isolation=2
OPEN connection=14 isolation=2
SQL connection=13 thread=pool-3-thread-1 text=SELECT version FROM equipment WHERE tenant_id='T1' AND equipment_id='E1' binds=[]
SQL connection=14 thread=pool-3-thread-2 text=SELECT version FROM equipment WHERE tenant_id='T1' AND equipment_id='E1' binds=[]
SQL connection=14 thread=pool-3-thread-2 text=SELECT COUNT(*) FROM rental_contract WHERE tenant_id='T1' AND equipment_id='E1' AND status='RESERVED' AND starts_at<? AND ?<ends_at binds=[2026-10-03T11:30:00.123456789Z, 2026-10-03T10:00:00.123456789Z]
SQL connection=13 thread=pool-3-thread-1 text=SELECT COUNT(*) FROM rental_contract WHERE tenant_id='T1' AND equipment_id='E1' AND status='RESERVED' AND starts_at<? AND ?<ends_at binds=[2026-10-03T11:30:00.123456789Z, 2026-10-03T10:00:00.123456789Z]
SQL connection=13 thread=pool-3-thread-1 text=INSERT INTO rental_contract(tenant_id,contract_id,equipment_id,starts_at,ends_at,amount,currency,status,version) VALUES(?,?,?,?,?,?,?,?,?) binds=[T1, R1, E1, 2026-10-03T10:00:00.123456789Z, 2026-10-03T11:30:00.123456789Z, 25.00, CNY, RESERVED, 0]
ROWS connection=13 affected=1
COMMIT connection=13 count=1
CLOSE connection=13 openStatements=0
SQL connection=14 thread=pool-3-thread-2 text=INSERT INTO rental_contract(tenant_id,contract_id,equipment_id,starts_at,ends_at,amount,currency,status,version) VALUES(?,?,?,?,?,?,?,?,?) binds=[T1, R2, E1, 2026-10-03T10:00:00.123456789Z, 2026-10-03T11:30:00.123456789Z, 25.00, CNY, RESERVED, 0]
ROWS connection=14 affected=1
COMMIT connection=14 count=1
CLOSE connection=14 openStatements=0
PASS reservation race independent connections optimistic=false
PASS reservation CAS affected rows optimistic=false
RESERVATION_RACE optimistic=false first=Outcome[connection=13, affected=1, state=OK, millis=0] second=Outcome[connection=14, affected=1, state=OK, millis=0]
OPEN connection=15 isolation=2
SQL connection=15 thread=main text=SELECT COUNT(*) FROM rental_contract binds=[]
PASS unprotected overlapping reservations reproduced
CLOSE connection=15 openStatements=0
OPEN connection=16 isolation=2
SQL connection=16 thread=main text=DELETE FROM contract_line binds=[]
ROWS connection=16 affected=0
SQL connection=16 thread=main text=DELETE FROM rental_contract binds=[]
ROWS connection=16 affected=2
SQL connection=16 thread=main text=DELETE FROM equipment binds=[]
ROWS connection=16 affected=1
SQL connection=16 thread=main text=INSERT INTO equipment(tenant_id,equipment_id,category,state) VALUES('T1','E1','camera','ACTIVE') binds=[]
ROWS connection=16 affected=1
COMMIT connection=16 count=1
CLOSE connection=16 openStatements=0
OPEN connection=18 isolation=2
SQL connection=18 thread=pool-4-thread-1 text=SELECT version FROM equipment WHERE tenant_id='T1' AND equipment_id='E1' binds=[]
OPEN connection=17 isolation=2
SQL connection=17 thread=pool-4-thread-2 text=SELECT version FROM equipment WHERE tenant_id='T1' AND equipment_id='E1' binds=[]
SQL connection=18 thread=pool-4-thread-1 text=SELECT COUNT(*) FROM rental_contract WHERE tenant_id='T1' AND equipment_id='E1' AND status='RESERVED' AND starts_at<? AND ?<ends_at binds=[2026-10-03T11:30:00.123456789Z, 2026-10-03T10:00:00.123456789Z]
SQL connection=17 thread=pool-4-thread-2 text=SELECT COUNT(*) FROM rental_contract WHERE tenant_id='T1' AND equipment_id='E1' AND status='RESERVED' AND starts_at<? AND ?<ends_at binds=[2026-10-03T11:30:00.123456789Z, 2026-10-03T10:00:00.123456789Z]
SQL connection=18 thread=pool-4-thread-1 text=UPDATE equipment SET version=version+1 WHERE tenant_id='T1' AND equipment_id='E1' AND version=? binds=[0]
ROWS connection=18 affected=1
SQL connection=18 thread=pool-4-thread-1 text=INSERT INTO rental_contract(tenant_id,contract_id,equipment_id,starts_at,ends_at,amount,currency,status,version) VALUES(?,?,?,?,?,?,?,?,?) binds=[T1, R1, E1, 2026-10-03T10:00:00.123456789Z, 2026-10-03T11:30:00.123456789Z, 25.00, CNY, RESERVED, 0]
ROWS connection=18 affected=1
COMMIT connection=18 count=1
CLOSE connection=18 openStatements=0
SQL connection=17 thread=pool-4-thread-2 text=UPDATE equipment SET version=version+1 WHERE tenant_id='T1' AND equipment_id='E1' AND version=? binds=[0]
ROWS connection=17 affected=0
ROLLBACK connection=17 count=1
CLOSE connection=17 openStatements=0
PASS reservation race independent connections optimistic=true
PASS reservation CAS affected rows optimistic=true
RESERVATION_RACE optimistic=true first=Outcome[connection=18, affected=1, state=OK, millis=0] second=Outcome[connection=17, affected=0, state=VERSION_CONFLICT, millis=0]
OPEN connection=19 isolation=2
SQL connection=19 thread=main text=SELECT COUNT(*) FROM rental_contract binds=[]
PASS one reservation survives device version protocol
SQL connection=19 thread=main text=SELECT COUNT(*) FROM rental_contract WHERE tenant_id='T1' AND equipment_id='E1' AND status='RESERVED' AND starts_at<? AND ?<ends_at binds=[2026-10-03T11:30:00.123456789Z, 2026-10-03T10:00:00.123456789Z]
PASS retry must recheck availability and reject
CLOSE connection=19 openStatements=0
OPEN connection=20 isolation=2
SQL connection=20 thread=main text=DELETE FROM contract_line binds=[]
ROWS connection=20 affected=0
SQL connection=20 thread=main text=DELETE FROM rental_contract binds=[]
ROWS connection=20 affected=1
SQL connection=20 thread=main text=DELETE FROM equipment binds=[]
ROWS connection=20 affected=1
SQL connection=20 thread=main text=INSERT INTO equipment(tenant_id,equipment_id,category,state) VALUES('T1','E1','camera','ACTIVE') binds=[]
ROWS connection=20 affected=1
COMMIT connection=20 count=1
CLOSE connection=20 openStatements=0
OPEN connection=21 isolation=2
SQL connection=21 thread=pool-5-thread-1 text=SELECT equipment_id FROM equipment WHERE tenant_id='T1' AND equipment_id='E1' FOR UPDATE binds=[]
SQL connection=21 thread=pool-5-thread-1 text=SELECT COUNT(*) FROM rental_contract WHERE tenant_id='T1' AND equipment_id='E1' AND status='RESERVED' AND starts_at<? AND ?<ends_at binds=[2026-10-03T11:30:00.123456789Z, 2026-10-03T10:00:00.123456789Z]
OPEN connection=22 isolation=2
SQL connection=22 thread=pool-5-thread-2 text=SET LOCK_TIMEOUT 5000 binds=[]
ROWS connection=22 affected=0
SQL connection=22 thread=pool-5-thread-2 text=SELECT equipment_id FROM equipment WHERE tenant_id='T1' AND equipment_id='E1' FOR UPDATE binds=[]
PASS waiter actually blocked before owner release
SQL connection=21 thread=pool-5-thread-1 text=INSERT INTO rental_contract(tenant_id,contract_id,equipment_id,starts_at,ends_at,amount,currency,status,version) VALUES(?,?,?,?,?,?,?,?,?) binds=[T1, LOCKED, E1, 2026-10-03T10:00:00.123456789Z, 2026-10-03T11:30:00.123456789Z, 25.00, CNY, RESERVED, 0]
ROWS connection=21 affected=1
COMMIT connection=21 count=1
CLOSE connection=21 openStatements=0
SQL connection=22 thread=pool-5-thread-2 text=SELECT COUNT(*) FROM rental_contract WHERE tenant_id='T1' AND equipment_id='E1' AND status='RESERVED' AND starts_at<? AND ?<ends_at binds=[2026-10-03T11:30:00.123456789Z, 2026-10-03T10:00:00.123456789Z]
COMMIT connection=22 count=1
CLOSE connection=22 openStatements=0
PASS waiter sees committed overlap after acquiring lock
PASS lock owner and waiter independent connections
LOCK_RESULT timeout=false owner=21 waiter=Outcome[connection=22, affected=0, state=OK, millis=152]
OPEN connection=23 isolation=2
SQL connection=23 thread=main text=SELECT equipment_id FROM equipment WHERE tenant_id='T1' AND equipment_id='E1' FOR UPDATE binds=[]
SQL connection=23 thread=main text=SELECT COUNT(*) FROM rental_contract binds=[]
SQL connection=23 thread=main text=SELECT COUNT(*) FROM rental_contract WHERE tenant_id='T1' AND equipment_id='E1' AND status='RESERVED' AND starts_at<? AND ?<ends_at binds=[2026-10-03T11:30:00.123456789Z, 2026-10-03T10:00:00.123456789Z]
PASS fresh locked retry sees one committed reservation
ROLLBACK connection=23 count=1
CLOSE connection=23 openStatements=0
OPEN connection=24 isolation=2
SQL connection=24 thread=main text=DELETE FROM contract_line binds=[]
ROWS connection=24 affected=0
SQL connection=24 thread=main text=DELETE FROM rental_contract binds=[]
ROWS connection=24 affected=1
SQL connection=24 thread=main text=DELETE FROM equipment binds=[]
ROWS connection=24 affected=1
SQL connection=24 thread=main text=INSERT INTO equipment(tenant_id,equipment_id,category,state) VALUES('T1','E1','camera','ACTIVE') binds=[]
ROWS connection=24 affected=1
COMMIT connection=24 count=1
CLOSE connection=24 openStatements=0
OPEN connection=25 isolation=2
SQL connection=25 thread=pool-6-thread-1 text=SELECT equipment_id FROM equipment WHERE tenant_id='T1' AND equipment_id='E1' FOR UPDATE binds=[]
SQL connection=25 thread=pool-6-thread-1 text=SELECT COUNT(*) FROM rental_contract WHERE tenant_id='T1' AND equipment_id='E1' AND status='RESERVED' AND starts_at<? AND ?<ends_at binds=[2026-10-03T11:30:00.123456789Z, 2026-10-03T10:00:00.123456789Z]
OPEN connection=26 isolation=2
SQL connection=26 thread=pool-6-thread-2 text=SET LOCK_TIMEOUT 200 binds=[]
ROWS connection=26 affected=0
SQL connection=26 thread=pool-6-thread-2 text=SELECT equipment_id FROM equipment WHERE tenant_id='T1' AND equipment_id='E1' FOR UPDATE binds=[]
SQL_FAILURE connection=26 state=HYT00 code=50200
ROLLBACK connection=26 count=1
CLOSE connection=26 openStatements=0
PASS real H2 lock timeout HYT00/50200
SQL connection=25 thread=pool-6-thread-1 text=INSERT INTO rental_contract(tenant_id,contract_id,equipment_id,starts_at,ends_at,amount,currency,status,version) VALUES(?,?,?,?,?,?,?,?,?) binds=[T1, LOCKED, E1, 2026-10-03T10:00:00.123456789Z, 2026-10-03T11:30:00.123456789Z, 25.00, CNY, RESERVED, 0]
ROWS connection=25 affected=1
COMMIT connection=25 count=1
CLOSE connection=25 openStatements=0
PASS lock owner and waiter independent connections
LOCK_RESULT timeout=true owner=25 waiter=Outcome[connection=26, affected=0, state=HYT00/50200, millis=422]
OPEN connection=27 isolation=2
SQL connection=27 thread=main text=SELECT equipment_id FROM equipment WHERE tenant_id='T1' AND equipment_id='E1' FOR UPDATE binds=[]
SQL connection=27 thread=main text=SELECT COUNT(*) FROM rental_contract binds=[]
SQL connection=27 thread=main text=SELECT COUNT(*) FROM rental_contract WHERE tenant_id='T1' AND equipment_id='E1' AND status='RESERVED' AND starts_at<? AND ?<ends_at binds=[2026-10-03T11:30:00.123456789Z, 2026-10-03T10:00:00.123456789Z]
PASS fresh locked retry sees one committed reservation
ROLLBACK connection=27 count=1
CLOSE connection=27 openStatements=0
RESULT enterprise09 checks=22
