Hibernate Pagination: Avoiding Duplicate Rows and Memory Blowups with setMaxResults
setMaxResults looks simple until a fetch join multiplies your rows. This article walks through the pagination traps in Hibernate ORM—duplicate parents, open cursors, and deep-page OFFSET costs—and shows safer patterns for each.