When ORM Becomes OMG: Performance Pitfalls in JPA and Friends
summary
A sample app FunFactStore uses Postgres, Java 25, Spring Boot 4, Spring Data JPA and Hikari to show concrete pitfalls: connection pooling is ~1000x faster than DriverManager (1,000 pool attempts in milliseconds vs ~4,000 ms with DriverManager), default pool size 10 causes spinners if connections are held, open session in view keeps connections for ~649 ms vs ~12 ms when disabled, set autoCommit/providedDisableAutoCommit, use TransactionTemplate to avoid long-held connections, prefer lazy many‑to‑one, join fetch or DTO projections (JPQL/native/interface), use Hikari debug, Testcontainers, IntelliJ and Gatling for diagnosis.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 3:34Connection pooling essentials
- 10:54Open Session in View
- 18:55Connection management best practices
- 21:04JPA and Hibernate basics
- 25:19Eager vs lazy loading
- 31:20N+1 queries solution
- 35:18DTO projections
- 39:58JPA mappings
- 43:31Conclusion and Q&A
related talks
47mWhen 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
52mJava Persistence and Hibernate Tips that can boost up your application performance
44mORM Insights - How not to hurt yourself?
46mThe State of Java Relational Persistence
46mMastering JPA Performance
