When ORM Becomes OMG: Performance Pitfalls in JPA and Friends
summary
A demo app, FunFactStore, shows concrete JPA pitfalls and fixes: a unit test finds Hikari pool is ~5000x faster than DriverManager; leaving spring.jpa.open-in-view=true holds connections during view rendering causes 646 ms leases while external calls run; setting autoCommit=false and letting Hibernate know cuts connection hold time to ~11 ms; lazy many-to-one plus join fetch or DTO projections eliminate N+1 queries; TransactionTemplate isolates external calls and prevents pool exhaustion.
AI-written summary · about
chapters (12)
- 0:00Introduction and setup
- 3:43Connection pooling importance
- 11:48Optimizing connection usage
- 21:24Fun facts interlude
- 21:46JPA and Hibernate basics
- 25:17Eager vs lazy fetching
- 27:07First-level cache explained
- 30:58N+1 query problem
- 33:28DTO projections vs entity mapping
- 41:34JPA mapping best practices
- 44:02Helpful tools and resources
- 45:47Closing and Q&A
related talks
45mWhen ORM Becomes OMG: Performance Pitfalls in JPA and Friends
51mWhen ORM Becomes OMG: Performance Pitfalls in JPA and Friends
44mPerformance oriented Spring Data JPA & Hibernate
49mPerformance oriented Spring Data JPA & Hibernate
44mORM Insights - How not to hurt yourself?
48mORM Iinsights - How to Not Hurt Yourself?
45mLazy Versus Eager Loading Strategies for JPA 2.1
46mMastering JPA Performance
