Hibernate ORM pagination with PostgreSQL: ensuring idempotent retries for offset-based queries
Goal: guarantee that a transient failure during a paginated Hibernate query does not cause duplicate or missing rows when the request is retried with the same offset and limit. Constraint: Hibernate translates setFirstResult() and setMaxResults() to database‑specific LIMIT/OFFSET clauses, which rely on the current ordering of rows. If the underlying data cha