~/talk

Cause of Death: Spring Data JPA

Talkat Spring I/O 2025 · 2025-05-22..05-23· [databases]
links:none on file
slides:none on file

Spring Data JPA with Hibernate shows concrete failure modes and fixes: switching fetch to eager causes lazy initialization exception avoidance but creates N+1 selects (six authors -> six extra queries), modeling many‑to‑many as List triggers deletes and reinserts and can raise multiple bag fetch exception, query caching behaves differently between Hibernate 5 and 6 (shallow vs full) and often invalidates, repository @Modifying needs flushAutomatically+clearAutomatically to see DB updates, and misused cascading can cascade remove gone wrong and wipe data.

AI-written summary · about

  1. 0:00Spring Data JPA pitfalls
  2. 4:04Lazy initialization exceptions
  3. 8:05N+1 select issue
  4. 10:33Solving N+1 with join fetch
  5. 13:05Many-to-many lists vs sets
  6. 16:37Multiple bag fetch exceptions
  7. 21:07Caching pitfalls
  8. 28:44Interface projections
  9. 39:27JPA performance tips
  10. 40:31Join fetch inconsistencies
  11. 44:13Modifying annotations
  12. 47:50Bidirectional relationships
  13. 49:36Cascading dangers
  14. 51:21Resources and closing
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.