• Sources: primary, discussion
  • Summary: Bartosz Osipiuk traced lost soft-delete updates to Hibernate's managedFlush, which skips the flush with only a TRACE log when the session factory is closed, after which the JDBC commit still succeeds with whatever was already sent. He reproduced it on Hibernate 6.6 through 8.0.0.Beta3 via Kafka, RabbitMQ, HTTP, @Async and @Scheduled entry points, with a window of about 1.2 ms between closing Hibernate and HikariCP in a plain Spring Boot 4.1 app. The post proposes a transaction Synchronization guard that refuses the commit when the factory is closed.
  • Why it matters: Spring and Hibernate services doing slow work inside transactions can lose writes during routine pod scale-down, so a commit guard is worth adding.