SqlContainer fetch wrong records at page boundary

I wrote an implementation for FreeformStatementDelegate for Oracle paging.

When I scroll to the end of a page e.g. 186, is it followed by records of the next page, i.e. 387,388… and back to normal at the beginning of the page, i.e 200, 201.

The component seems to issue more sql fetch than needed as I scroll.

e.g.

select * from (select a_., rownum rnum from (select id from tableA) a_ ) where rnum between ? and ? 1 200
select * from (select a_.
, rownum rnum from (select id from tableA) a_ ) where rnum between ? and ? 201 400
select * from (select a_., rownum rnum from (select id from tableA) a_ ) where rnum between ? and ? 1 200
select * from (select a_.
, rownum rnum from (select id from tableA) a_ ) where rnum between ? and ? 201 400

Is this a bug in SqlContainer or my FreeformStatementDelegate implementation?

I have attached my code and screenshot.

Cheers,

Ray
12909.png
12910.java (3.94 KB)