Java Persistence and Hibernate Tips that can boost up your application performance
summary
Explains concrete fixes and numbers: avoid the JPA table generator doubles connections for high concurrency and prefer identity or sequence; enable JDBC/driver statement caching and upgrade drivers for Oracle/SQL Server/Postgres/MySQL to gain measurable plan cache hits; turn on batching and Postgres rewriteBatchedStatements to collapse roundtrips; set session/query read-only to drop snapshots; prefer pagination over streaming when plans change; use dynamic-update or session update instead of merge for large detached batches; delay connection acquisition via pool autoCommit=false.
AI-written summary · about
chapters (58)
- 0:00Introduction
- 0:30About me
- 1:22Mappings
- 2:57How does it work
- 3:35Concerns
- 4:22Identity vs Table
- 5:21AutoGenerator
- 6:32Sequence
- 7:27Database Mappings
- 8:41Dedicated Type
- 9:11Custom Type
- 9:40Supported types
- 10:37JSON support
- 12:44Execution Plan Cache
- 14:29SQL Server
- 16:46Statement Caching
- 18:04SQL Server Driver
- 19:30Statement Cache Support
- 19:55Statement Cache MySQL
- 20:27Query API
- 20:54Reusing Execution Plan
- 21:10Bind Mode
- 21:26In Clause
- 21:37In Clause Variance
- 22:27Reusing an Execution Plan
- 23:42Query Plan Cache
- 24:39Query Plan Cache Performance
- 26:13Distinct
- 27:38Distinct in SQL
- 28:11Remove duplicates in hibernate
- 28:26Check the execution plan
- 30:03Loading Time Snapshot
- 30:25ReadOnly True
- 31:14Spring Framework
- 32:13Pagination
- 32:39Fetch
- 32:59Streaming
- 33:32Get Resolved Stream
- 33:55Database Cursor
- 34:29Stream
- 35:05Execution Plan
- 35:50Streaming vs Pagination
- 40:09Batching
- 41:17Persistence
- 41:50Persistence context
- 42:02Batch processing
- 42:38Batching for Hibernate
- 43:26Batching for Postgres
- 44:00Rewrite Batch
- 44:35Hibernate Update
- 46:04Hibernate Dynamic Update
- 46:33Hibernate Detach Entity
- 47:11Hibernate Merge Entity
- 47:36Hibernate Call Session Update
- 48:13Managing Connections
- 50:18Connection Pool
- 51:10Delay Connection Acquisition
- 51:53Thank you
related talks
46mMastering JPA Performance
44mPerformance oriented Spring Data JPA & Hibernate
49mPerformance oriented Spring Data JPA & Hibernate
52mHibernate performance tuning
45mWhen ORM Becomes OMG: Performance Pitfalls in JPA and Friends
44mORM Insights - How not to hurt yourself?
51mWhen ORM Becomes OMG: Performance Pitfalls in JPA and Friends
47mWhen ORM Becomes OMG: Performance Pitfalls in JPA and Friends
