findListIteratorBycondition w/findOptions and fetchSize?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

findListIteratorBycondition w/findOptions and fetchSize?

Ruth Hoffman
Hello All:
I'd like to verify that the purpose of *findOptions.setFetchSize(size)*
will return a result set of the given size. For example, if I say:
*findOptions.setFetchSize(20)*, I'll get back 20 GenericObjects -
assuming that all the other conditionals are met. And then my
EntityListIterator will only iterate over those 20 objects?

Is this the purpose of the setFetchSize method? If not, what should I be
using to only return a fixed number of records for a given query?

TIA
Ruth
Reply | Threaded
Open this post in threaded view
|

Re: findListIteratorBycondition w/findOptions and fetchSize?

David E Jones-2

The fetch size is only the number of results pulled over each time the JDBC driver talks to the database. Usually a value of around 100 is good.

If you want to create a list that has a limited number of results, use the delegator methods that return an EntityListIterator, and then use the eli.getPartialList method.

-David


Ruth Hoffman wrote:

> Hello All:
> I'd like to verify that the purpose of *findOptions.setFetchSize(size)*
> will return a result set of the given size. For example, if I say:
> *findOptions.setFetchSize(20)*, I'll get back 20 GenericObjects -
> assuming that all the other conditionals are met. And then my
> EntityListIterator will only iterate over those 20 objects?
>
> Is this the purpose of the setFetchSize method? If not, what should I be
> using to only return a fixed number of records for a given query?
>
> TIA
> Ruth

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: findListIteratorBycondition w/findOptions and fetchSize?

Ruth Hoffman
Thanks David!

David E. Jones wrote:

>
> The fetch size is only the number of results pulled over each time the
> JDBC driver talks to the database. Usually a value of around 100 is good.
>
> If you want to create a list that has a limited number of results, use
> the delegator methods that return an EntityListIterator, and then use
> the eli.getPartialList method.
>
> -David
>
>
> Ruth Hoffman wrote:
>
>> Hello All:
>> I'd like to verify that the purpose of
>> *findOptions.setFetchSize(size)* will return a result set of the
>> given size. For example, if I say: *findOptions.setFetchSize(20)*,
>> I'll get back 20 GenericObjects - assuming that all the other
>> conditionals are met. And then my EntityListIterator will only
>> iterate over those 20 objects?
>>
>> Is this the purpose of the setFetchSize method? If not, what should I
>> be using to only return a fixed number of records for a given query?
>>
>> TIA
>> Ruth
>