Re: Sort fails on setPageSize

From: Tore Halset (halse..vv.ntnu.no)
Date: Wed Mar 07 2007 - 16:59:06 EST

  • Next message: Frank: "Re: Sort fails on setPageSize"

    Hi,

    Would it be possible to reissue the query and let the database do the
    sorting? Otherwise sorting does not make sense before you have
    fetched all of the data and then you do not need page size.

      - Tore.

    On Mar 7, 2007, at 22:26, Frank wrote:

    > Hello,
    >
    > My sort works fine until I set the Page Size.
    >
    > I need to limit the records per page as I have 35000 in table.
    >
    > Thanks
    >
    > Frank
    >
    > query.setPageSize(50);
    >
    > causes this error:
    >
    > java.lang.UnsupportedOperationException: set operation not supported
    > at org.objectstyle.cayenne.access.IncrementalFaultList
    > $IncrementalListIterator.set(IncrementalFaultList.java:962)
    > at java.util.Collections.sort(Unknown Source)
    > at net.sf.click.control.Table.sortRowList(Table.java:1290)
    > at net.sf.click.control.Table.toString(Table.java:988)
    > at org.apache.velocity.runtime.parser.node.ASTReference.render
    > (ASTReference.java:336)
    > at org.apache.velocity.runtime.parser.node.SimpleNode.render
    > (SimpleNode.java:324)
    > at org.apache.velocity.runtime.directive.Parse.render(Parse.java:224)
    > at org.apache.velocity.runtime.parser.node.ASTDirective.render
    > (ASTDirective.java:136)
    > at org.apache.velocity.runtime.parser.node.SimpleNode.render
    > (SimpleNode.java:324)
    > at org.apache.velocity.Template.merge(Template.java:259)
    > at net.sf.click.ClickServlet.renderTemplate(ClickServlet.java:591)
    > at net.sf.click.ClickServlet.processPage(ClickServlet.java:535)
    > at net.sf.click.ClickServlet.handleRequest(ClickServlet.java:357)
    > at net.sf.click.ClickServlet.doGet(ClickServlet.java:280)
    > at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    > (ApplicationFilterChain.java:252)
    > at org.apache.catalina.core.ApplicationFilterChain.doFilter
    > (ApplicationFilterChain.java:173)
    > at net.sf.click.extras.cayenne.DataContextFilter.doFilter
    > (DataContextFilter.java:125)
    > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    > (ApplicationFilterChain.java:202)
    > at org.apache.catalina.core.ApplicationFilterChain.doFilter
    > (ApplicationFilterChain.java:173)
    > at org.apache.catalina.core.StandardWrapperValve.invoke
    > (StandardWrapperValvejava:213)
    > at org.apache.catalina.core.StandardContextValve.invoke
    > (StandardContextValvejava:178)
    > at org.apache.catalina.core.StandardHostValve.invoke
    > (StandardHostValve.java:126)
    > at org.apache.catalina.valves.ErrorReportValve.invoke
    > (ErrorReportValve.java:105)
    > at org.apache.catalina.core.StandardEngineValve.invoke
    > (StandardEngineValve.java:107)
    > at org.apache.catalina.connector.CoyoteAdapter.service
    > (CoyoteAdapter.java:148)
    > at org.apache.coyote.http11.Http11Processor.process
    > (Http11Processor.java:869)
    > at org.apache.coyote.http11.Http11BaseProtocol
    > $Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:
    > 664)
    > at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    > (PoolTcpEndpoint.java:527)
    > at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt
    > (LeaderFollowerWorkerThread.java:80)
    > at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
    > (ThreadPool.java:684)
    > at java.lang.Thread.run(Unknown Source)



    This archive was generated by hypermail 2.0.0 : Wed Mar 07 2007 - 16:59:00 EST