Hibernate and Performance: Take Back Control
summary
Practical Hibernate performance fixes: enable hibernate.jdbc.batch_size and switch ID generation from IDENTITY to SEQUENCE to allow batching (example: 1000-film insert time falls from ~15s to <2s with batch sizes ~10–50). For very large imports use StatelessSession to reduce memory and time, disable OpenSessionInView, fix N+1 by replacing join fetch with two queries, mark read-only transactions, and use IN-clause padding to stabilize query plan reuse.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 9:13Hibernate and ORM
- 12:03Initial performance issue
- 21:12Batching inserts
- 27:52StatelessSession memory
- 33:17N+1 problem solved
- 40:03Optimizing read queries
- 45:02When to use Hibernate
- 46:30Q&A
related talks
45mHibernate: Mapping Strategies and Their Database Performance Impact
58mCause of Death: Hibernate.
44mPerformance oriented Spring Data JPA & Hibernate
49mPerformance oriented Spring Data JPA & Hibernate
53mHibernate you know it… but actually you don’t
45mLazy Versus Eager Loading Strategies for JPA 2.1
45mWhen ORM Becomes OMG: Performance Pitfalls in JPA and Friends
51mHibernate you know it... but actually you don't
