Commits
Tarun Sukhani authored b6a38fd2bc2
fix(fixtures): evict the second-level cache after executeSQL (PF-191) Fixtures.executeSQL() runs its script with DB.execute, past Hibernate, and called no hook at all, so after PF-190 it was the one fixture write that left the second-level cache as it was: an updated row kept its old values, and a cached collection or cacheable query missed the rows it inserted. It now evicts every region of the default persistence unit's cache, the one its script writes to, when a JPA transaction is open. It does not call afterFixtureLoad(), which also clears the entity manager and would detach every entity the caller had loaded, so that a lazy load throws and a later save() fails. The cost, which the new Javadoc states: an entity the same transaction loaded before the script keeps its old values until it is refreshed. Guarded by four cases in integration.FixturesSecondLevelCacheTest, one of which fails if executeSQL() clears the entity manager. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>