You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by John Emmanuel <em...@gmail.com> on 2008/04/02 09:49:05 UTC

Paging in web application

Hi,

Is there a best practice for paging in a web application.
If so, can somebody please direct me to a demo/article/tutorial.

If none is available could somebody  just briefly tell me how
they incorporated paging in a production webapp.

I have read the documentation (which provides examples
of paging in desktop apps), have gone through the
petstore example (which uses ibatis PaginatedList (which btw has
now been deprecated), but am not clear about the best way
to go about it.

regards,
John Emmanuel

Re: Paging in web application

Posted by Michael Gentry <bl...@gmail.com>.
Pretty slick looking app ... but, no iPhone?  :-)


On Wed, Apr 2, 2008 at 6:25 AM, Malcolm Edgar <ma...@gmail.com> wrote:
> Hi Andrus,
>
>  thanks for the links. Interesting read, I always find it interesting
>  where performance issues can lie.
>
>  Below is a link to a Cayenne backed application we developed. Its
>  running on 2.x code base, so I am looking forward to the 3.0 upgrade
>  soon.
>
>    http://apps.telstra.com/productcenter/avoka.pc.telstra.flex/
>
>  regards Malcolm Edgar

Re: Paging in web application

Posted by Malcolm Edgar <ma...@gmail.com>.
Hi Andrus,

thanks for the links. Interesting read, I always find it interesting
where performance issues can lie.

Below is a link to a Cayenne backed application we developed. Its
running on 2.x code base, so I am looking forward to the 3.0 upgrade
soon.

   http://apps.telstra.com/productcenter/avoka.pc.telstra.flex/

regards Malcolm Edgar

On Wed, Apr 2, 2008 at 9:10 PM, Andrus Adamchik <an...@objectstyle.org> wrote:
> Hi Malcolm,
>
>  Here they are:
>
>  (3.0M1) https://issues.apache.org/cayenne/browse/CAY-810
>  (3.0M4, unreleased) https://issues.apache.org/cayenne/browse/CAY-999
>
>  There are also a few other jiras that dealt with proper caching support for
> paginated lists.
>
>  Andrus
>
>
>
>
>  On Apr 2, 2008, at 12:59 PM, Malcolm Edgar wrote:
>
>
> > What were the big paging performance improvements in 3.0?
> >
> > regards Malcolm Edgar
> >
> > On Wed, Apr 2, 2008 at 7:27 PM, Robert Zeigler <ro...@puregumption.com>
> wrote:
> >
> > > Typically, you're just going to use a paginated query:
> > > SelectQuery q = new SelectQuery(Artist.class);
> > > q.setPageSize(50);//triggers the pagination.
> > >
> > > You can get the size of the result set without faulting every (or any)
> > > object in it, jump to specific objects w/in the query (and only fault
> the
> > > "neighboring" objects on the same page), etc.
> > > This works well for most things.  With the recent performances
> improvements
> > > in 3.0, this works wonderfully for a large portion of use cases out
> there.
> > > You can also use setFetchLimit to limit the # of results returned.
> > > Unfortunately, there's no corresponding "setOffset" method.  But you can
> > > use SQLTemplate to accomplish the task, if you really need it.
> > >
> > > Robert
> > >
> > >
> > >
> > > On Apr 2, 2008, at 4/22:49 AM , John Emmanuel wrote:
> > >
> > >
> > > > Hi,
> > > >
> > > > Is there a best practice for paging in a web application.
> > > > If so, can somebody please direct me to a demo/article/tutorial.
> > > >
> > > > If none is available could somebody  just briefly tell me how
> > > > they incorporated paging in a production webapp.
> > > >
> > > > I have read the documentation (which provides examples
> > > > of paging in desktop apps), have gone through the
> > > > petstore example (which uses ibatis PaginatedList (which btw has
> > > > now been deprecated), but am not clear about the best way
> > > > to go about it.
> > > >
> > > > regards,
> > > > John Emmanuel
> > > >
> > > >
> > >
> > >
> > >
> >
> >
>
>

Re: Paging in web application

Posted by Andrus Adamchik <an...@objectstyle.org>.
Hi Malcolm,

Here they are:

(3.0M1) https://issues.apache.org/cayenne/browse/CAY-810
(3.0M4, unreleased) https://issues.apache.org/cayenne/browse/CAY-999

There are also a few other jiras that dealt with proper caching  
support for paginated lists.

Andrus


On Apr 2, 2008, at 12:59 PM, Malcolm Edgar wrote:

> What were the big paging performance improvements in 3.0?
>
> regards Malcolm Edgar
>
> On Wed, Apr 2, 2008 at 7:27 PM, Robert Zeigler <robertz@puregumption.com 
> > wrote:
>> Typically, you're just going to use a paginated query:
>> SelectQuery q = new SelectQuery(Artist.class);
>> q.setPageSize(50);//triggers the pagination.
>>
>> You can get the size of the result set without faulting every (or  
>> any)
>> object in it, jump to specific objects w/in the query (and only  
>> fault the
>> "neighboring" objects on the same page), etc.
>> This works well for most things.  With the recent performances  
>> improvements
>> in 3.0, this works wonderfully for a large portion of use cases out  
>> there.
>> You can also use setFetchLimit to limit the # of results returned.
>> Unfortunately, there's no corresponding "setOffset" method.  But  
>> you can
>> use SQLTemplate to accomplish the task, if you really need it.
>>
>> Robert
>>
>>
>>
>> On Apr 2, 2008, at 4/22:49 AM , John Emmanuel wrote:
>>
>>> Hi,
>>>
>>> Is there a best practice for paging in a web application.
>>> If so, can somebody please direct me to a demo/article/tutorial.
>>>
>>> If none is available could somebody  just briefly tell me how
>>> they incorporated paging in a production webapp.
>>>
>>> I have read the documentation (which provides examples
>>> of paging in desktop apps), have gone through the
>>> petstore example (which uses ibatis PaginatedList (which btw has
>>> now been deprecated), but am not clear about the best way
>>> to go about it.
>>>
>>> regards,
>>> John Emmanuel
>>>
>>
>>
>


Re: Paging in web application

Posted by Robert Zeigler <ro...@puregumption.com>.
Andrus did a lot of optimizing... it was in a dev thread awhile ago.   
Don't remember the specifics offhand, sorry.

Robert

On Apr 2, 2008, at 4/24:59 AM , Malcolm Edgar wrote:
> What were the big paging performance improvements in 3.0?
>
> regards Malcolm Edgar
>
> On Wed, Apr 2, 2008 at 7:27 PM, Robert Zeigler <robertz@puregumption.com 
> > wrote:
>> Typically, you're just going to use a paginated query:
>> SelectQuery q = new SelectQuery(Artist.class);
>> q.setPageSize(50);//triggers the pagination.
>>
>> You can get the size of the result set without faulting every (or  
>> any)
>> object in it, jump to specific objects w/in the query (and only  
>> fault the
>> "neighboring" objects on the same page), etc.
>> This works well for most things.  With the recent performances  
>> improvements
>> in 3.0, this works wonderfully for a large portion of use cases out  
>> there.
>> You can also use setFetchLimit to limit the # of results returned.
>> Unfortunately, there's no corresponding "setOffset" method.  But  
>> you can
>> use SQLTemplate to accomplish the task, if you really need it.
>>
>> Robert
>>
>>
>>
>> On Apr 2, 2008, at 4/22:49 AM , John Emmanuel wrote:
>>
>>> Hi,
>>>
>>> Is there a best practice for paging in a web application.
>>> If so, can somebody please direct me to a demo/article/tutorial.
>>>
>>> If none is available could somebody  just briefly tell me how
>>> they incorporated paging in a production webapp.
>>>
>>> I have read the documentation (which provides examples
>>> of paging in desktop apps), have gone through the
>>> petstore example (which uses ibatis PaginatedList (which btw has
>>> now been deprecated), but am not clear about the best way
>>> to go about it.
>>>
>>> regards,
>>> John Emmanuel
>>>
>>
>>


Re: Paging in web application

Posted by Malcolm Edgar <ma...@gmail.com>.
What were the big paging performance improvements in 3.0?

regards Malcolm Edgar

On Wed, Apr 2, 2008 at 7:27 PM, Robert Zeigler <ro...@puregumption.com> wrote:
> Typically, you're just going to use a paginated query:
>  SelectQuery q = new SelectQuery(Artist.class);
>  q.setPageSize(50);//triggers the pagination.
>
>  You can get the size of the result set without faulting every (or any)
> object in it, jump to specific objects w/in the query (and only fault the
> "neighboring" objects on the same page), etc.
>  This works well for most things.  With the recent performances improvements
> in 3.0, this works wonderfully for a large portion of use cases out there.
>  You can also use setFetchLimit to limit the # of results returned.
>  Unfortunately, there's no corresponding "setOffset" method.  But you can
> use SQLTemplate to accomplish the task, if you really need it.
>
>  Robert
>
>
>
>  On Apr 2, 2008, at 4/22:49 AM , John Emmanuel wrote:
>
> > Hi,
> >
> > Is there a best practice for paging in a web application.
> > If so, can somebody please direct me to a demo/article/tutorial.
> >
> > If none is available could somebody  just briefly tell me how
> > they incorporated paging in a production webapp.
> >
> > I have read the documentation (which provides examples
> > of paging in desktop apps), have gone through the
> > petstore example (which uses ibatis PaginatedList (which btw has
> > now been deprecated), but am not clear about the best way
> > to go about it.
> >
> > regards,
> > John Emmanuel
> >
>
>

Re: Paging in web application

Posted by Robert Zeigler <ro...@puregumption.com>.
Typically, you're just going to use a paginated query:
SelectQuery q = new SelectQuery(Artist.class);
q.setPageSize(50);//triggers the pagination.

You can get the size of the result set without faulting every (or any)  
object in it, jump to specific objects w/in the query (and only fault  
the "neighboring" objects on the same page), etc.
This works well for most things.  With the recent performances  
improvements in 3.0, this works wonderfully for a large portion of use  
cases out there.
You can also use setFetchLimit to limit the # of results returned.
Unfortunately, there's no corresponding "setOffset" method.  But you  
can use SQLTemplate to accomplish the task, if you really need it.

Robert

On Apr 2, 2008, at 4/22:49 AM , John Emmanuel wrote:
> Hi,
>
> Is there a best practice for paging in a web application.
> If so, can somebody please direct me to a demo/article/tutorial.
>
> If none is available could somebody  just briefly tell me how
> they incorporated paging in a production webapp.
>
> I have read the documentation (which provides examples
> of paging in desktop apps), have gone through the
> petstore example (which uses ibatis PaginatedList (which btw has
> now been deprecated), but am not clear about the best way
> to go about it.
>
> regards,
> John Emmanuel