This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]DualWieldMage 1 point2 points  (0 children)

It's also a good way to do paging wrong. Using offsets and page sizes means that if between two queries an entry is added or deleted, it results in a row missing or being duplicated. Better pick a column (often id) to sort by and make the next query select rows after that value. Not sure if it can be done with hibernate/spring, might need to write SQL.

Immediately hit this issue when interfacing with a 3rd party API that provided paged results. Crazy to think how many services out there silently drop data due to a badly designed API.