The Complexity of JPA
summary
Shows concrete JPA behaviors backed by runnable tests using Testcontainers and NamedParameterJdbcOperations: persist may not insert — insert happens only when ID strategy forces it or on flush/commit; find and queries return cached instances — queries hit the DB but then return the persistence-context object, producing stale field values; changing elements inside a collection does not bump the owning entity’s version while adding/removing does; proposes Spring Data JDBC uses aggregates, no proxies or first-level cache, and the tests all pass.
AI-written summary · about
chapters (9)
- 0:00Introduction and audience
- 2:56EntityManager persist behavior
- 11:03EntityManager find behavior
- 15:18Query results and cache
- 17:49Optimistic locking with collections
- 22:26Java records in JPA
- 23:27Why JPA is so complex
- 28:43Alternatives to JPA
- 33:04Summary and Q&A
related talks
46mThe State of Java Relational Persistence
42mJPA - Beyond copy-paste
47mThere is always a choice. Spring Data JDBC vs. Hibernate. Taras Boychuk. Java Fest 2020 Online
49mPerformance oriented Spring Data JPA & Hibernate
44mPerformance oriented Spring Data JPA & Hibernate
47mWhen ORM Becomes OMG: Performance Pitfalls in JPA and Friends
51mWhen ORM Becomes OMG: Performance Pitfalls in JPA and Friends
51mThe Persistence Heavyweight Championship: JPA vs. jOOQ
