On 14.09.2012, at 07:41, Thomas Mueller <[email protected]> wrote:

> If getSize() returns -1 then you know for sure there are more than 20
> results, so you know you have to display 'next page'.

How do I know it's for sure more than 20, or whatever my page size happens to 
be? -1 simply means: "no idea". That the implementation does a timeout handling 
cannot really be assumed on a JCR application level.

>> In that case the oak getSize(max) is probably a better fit.
> 
> If you call getSize(Integer.MAX_VALUE), then no, it's worse, because that
> call might take hours. The only thing where it helps is if you have a
> different page size than 20.

I was not referring to Integer.MAX_VALUE, but simply to the proposed new method.

> Please note if you use offset and limit, getSize() will return the size of
> the result minus the offset (it will give you the number of rows you can
> read from the result).

Really? Is that according to the JCR spec?

Cheers,
Alex

Reply via email to