Seven runnable scenarios that record the real JDBC SQL under hibernate.flush.queue.type=legacy and graph: insert order, delete order, unique delete-then-reinsert, unique swap, NOT NULL FK, batching, setting values. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b3obqqePfZ9m2Jk5Ub
1.2 KiB
1.2 KiB
Hibernate 8 graph-based flush ordering
Runnable companion to the ankurm.com post on Hibernate ORM 8's graph-based flush coordination.
Each test runs the same unit of work against hibernate.flush.queue.type=legacy and graph, and
records the SQL that actually reached JDBC. The test asserts the same facts the post quotes.
Tested on Hibernate ORM 8.0.0.CR2 (release candidate, 24 Nov 2026), Jakarta Persistence 4.0.0-M8 (resolved transitively), H2 2.5.252, Temurin 25.0.5.1, Maven 3.9.11. Pre-release: behaviour may change before GA.
./scripts/run-all.sh # runs the tests and prints target/transcripts/*.txt
./scripts/inspect-settings.sh # prints the real setting names and enum values from the jar
| File | What it shows |
|---|---|
src/main/java/com/ankurm/flush/ |
Author, Post (nullable FK), Comment (NOT NULL FK), Account (unique email) |
src/test/java/com/ankurm/flush/Lab.java |
boots a SessionFactory with the chosen queue type |
src/test/java/com/ankurm/flush/SqlRecorder.java |
JDBC wrapper that records SQL with bound values |
src/test/java/com/ankurm/flush/FlushOrderingTest.java |
the seven scenarios |
This module is self-contained; the other module in this repository (../) is the EntityAgent demo on CR1.