Mastering JPA Performance
summary
Finds that most slowness comes from excessive SQL interactions and shows fixes that actually cut statements and time: switching the table generator default allocationSize=1 to a larger allocation (e.g. 100) reduces tens of thousands of ID fetches, enabling JDBC batching with batch size 100 and sorting by entity removes repeated flushes and yields 20–50x faster writes, using prefetch with IN and LEFT JOIN FETCH makes reads deterministic, and network latency can turn optimized local runs of seconds into minutes across continents. Tools: JPA/Hibernate, H2/Oracle/MariaDB, Docker, JUnit, Hibernate stats.
AI-written summary · about
chapters (10)
- 0:00Introduction to JPA performance
- 3:57Analyzing database creation
- 7:14Optimizing ID generation
- 11:58Batching and database interaction
- 21:09Reading entities efficiently
- 24:29Advanced querying techniques
- 29:16Data-dependent performance
- 33:41Updating and flushing entities
- 37:40Latency and caching considerations
- 41:59Conclusion and best practices
related talks
52mJava Persistence and Hibernate Tips that can boost up your application performance
44mPerformance oriented Spring Data JPA & Hibernate
51mWhen ORM Becomes OMG: Performance Pitfalls in JPA and Friends
52mHibernate performance tuning
49mPerformance oriented Spring Data JPA & Hibernate
45mLazy Versus Eager Loading Strategies for JPA 2.1
45mWhen ORM Becomes OMG: Performance Pitfalls in JPA and Friends
47mWhen ORM Becomes OMG: Performance Pitfalls in JPA and Friends
