Eelco,
       What i mean is that, you don't necessary have to cache the result
just do the paging lists. you can directly call the db to query the page
just like that...

void iterator( int first, int count)
{
   db.getPage( parameter, first, count ).iterator();
}

int size()
{
   db.getPageCount( parameter );
}

This approach make heavy db call. Imagine there are 5000 concurrent users
making the same paging, with no constant data changing at the backend (
adding or deletion of data ), then the db will be heavy-loaded with
unnecessary duplication db call - size(). And I realise this is not an
efficient way of pagination, is it? 

To avoid this problem, you suggested to cache the results or even the result
size, so that subsequently paging call will not trigger the same 
db.getPageCount( parameter ) or even the db.getPage( parameter, first, count
).iterator();  Having said that, however, if you look at it, you will
realise caching is also not an efficient way of doing a paging list,
considering all the records returned might be a potential big record. And if
these records are stored in a List, the memory of the server will be eaten
away especially when the paging site is heavy loaded with concurrent users,
say 5000 concurrent users are doing the same paging. get me? :)

so what s the most optimized way of doing paging using the IDataProvider? 





Eelco Hillenius wrote:
> 
>> Why would want to cache the result?
> 
> Look, you have to make a decission. Are you interested in paging lists
> or not? If you are, you should do a count query to determine how many
> rows there are, and then just load the page of results you need with
> another one. If you don't want to use paging, but you want to display
> the whole result set at once, Timo's answer will work fine.
> 
>> what happened if the results returned are big
> 
> If the results can be big, use a pageable list. It's the whole point
> of the constructs we have that these components will load just what is
> needed instead of all the results.
> 
> Eelco
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> 
> 

-- 
View this message in context: 
http://www.nabble.com/IDataProvider.size%28%29-tf1317737.html#a11055761
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to