jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@adobe.com>
Subject Re: The infamous getSize() == -1 (Was: [jira] [Created] (OAK-300) Query: QueryResult.getRows().getSize())
Date Wed, 19 Sep 2012 12:08:13 GMT
On 14.09.2012, at 07:41, Thomas Mueller <mueller@adobe.com> 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
Mime
View raw message