I have 100 records in a database table with a specific status X. I want to fetch all the records using pagination say of pagesize 10. During processing of the fetched records, on some conditions, the records will be updated to status Y. However, if some conditions are not met, the status will not be updated and the record will be skipped. I am doing this using pageable object of Spring Data JPA.
Pageable pageable = PageRequest.of(0, 10);
Because of the update to a column, I think every time I get the next set of records in the page 0 itself. The issue is: Because some records can remain without being updated, after say when 10 records went without an update, those 10 records keep coming in the page 0, and I am never able to fetch the remaining records.
Please advice how to fetch records using pagination when there is an update involved.