Essentially I think what we will have to do is to to keep applying the ORDER BY and FOR UPDATE in the SQL statement, but return all results from beginning of results through max results using java.sql.Statement#setMaxRows equal to offset+limit and then "seek" through the returned result set to the requested first row using java.sql.ResultSet#absolute.
The problem with this is that will lock an awful lot of rows.
Essentially I think what we will have to do is to to keep applying the ORDER BY and FOR UPDATE in the SQL statement, but return all results from beginning of results through max results using java.sql.Statement#setMaxRows equal to offset+limit and then "seek" through the returned result set to the requested first row using java.sql.ResultSet#absolute.
The problem with this is that will lock an awful lot of rows.
But I do not really see an alternative.