Faulting Behavior with setPageSize() and Sort Ordering

From: Joe Baldwin (jfbaldwi..arthlink.net)
Date: Tue Jun 16 2009 - 13:31:24 EDT

  • Next message: Andrey Razumovsky: "Re: Faulting Behavior with setPageSize() and Sort Ordering"

    This is a question concerning making performance enhancements with
    Cayenne directives.

    Lets say you use the following SelectQuery method

            query.setPageSize(RowsPerPage);

    But then you decide to sort order the result list using

            Ordering order = new Ordering(<entity>.<attribute>_PROPERTY, true);
            order.orderList(resultList);

    If I understand the docs, then the purpose of setting the PageSize
    parameter is to reduce the work load (and increase performance) by
    limiting fetching to the first "RowsPerPage" amount of data-objects.

    I am wondering whether performing a sort ordering on the resultList
    triggers *all* the page and object faults. If I am correct then sort
    ordering would render setPageSize moot in this scenario.

    Is my analysis correct or has Cayenne somehow avoided this? (Or is
    there another way to do sort ordering?)

    Joe



    This archive was generated by hypermail 2.0.0 : Tue Jun 16 2009 - 13:32:08 EDT