Hello Felix,

note that making something transient is not as simple as just putting the word next to it, as in case of wicket it will fail not at once but later;

Also the use of Lists for data sending and/ or partitioning is an wicket-anti-pattern as it leads to 2 dramatic consequences:

- huge memory required
- slow speed cause by GC

Instead you only should use a own dataProvider;

Note that the 2 queries in there need to be "tuned" for their use, especially as the size() query will usually be run more than once;

So in your case you should instead cache the query and then construct it that way:

@Override
    public Iterator<? extends T> iterator(int first, int count) {
      -> "select id, *....* from A limit FIRST, COUNT";
    }



    @Override
    public int size() {
        -> "select count(id) from A";
    }

So you only query what is really needed and instead make the part within the query (e.g.:the querystring) be shared with the DataProvider;

Best






Am 05.04.11 18:48, schrieb felix:
  Hi Øyvind,

  Nice to hear the integration between both frameworks worked properly.

  We implemented a SortableDataProvider but in the method "Iterator
  iterator(int first, int count)" we do

  proposalsPage = queryRows.subList(first, first+count);

  when queryRows is a class variable of type SimpleIdIncrementalFaultList
  and not serializable.

  and  also used in :

  public int size() {           return (queryRows!=null) ? queryRows.size() : 0;
        }


  Doing          transient List<Proposal>   queryRows = null;  works but I am 
not
  sure about further consequences regarding clustering.

  How did you handle that SimpleIdIncrementalFaultList cayenne object?

  Thanks a lot
  Felix



  On Tue, 5 Apr 2011 08:24:04 -0700 (PDT), Øyvind Harboe [via Cayenne]
  <[email protected]>  wrote:
Hi Felix,

I've implemented paged queries using Cayenne and
Wicket.

As I recall you have to implement a "dataprovider" that
will run the query every time the page is rendered. The
objects that are serialized into the page must be small
(per design).

The dataprovider implements sorted, paged queries.

This worked well for a database with 100k's of records
and where I re-ran the query every time the user typed
a new char into a text field to narrow down the search
(including a back-off algorithm supported by the framework).

--
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 87 40 27

http://www.zylin.com/zy1000.html [1]
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer

-------------------------

If you reply to this email, your message will be added to the
discussion below:

http://cayenne.195.n3.nabble.com/paginated-queries-setPageSize-tp2779985p2780297.html
[2]
  To unsubscribe from paginated queries, setPageSize, click here [3].

Links:
------
[1] http://www.zylin.com/zy1000.html
[2]

http://cayenne.195.n3.nabble.com/paginated-queries-setPageSize-tp2779985p2780297.html
[3]

http://cayenne.195.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2779985&code=ZmVsaXguc2VycmFub0B0ZWNobmljYWxub3Jtcy5jb218Mjc3OTk4NXwtMjEyNzM3Njk3OQ==



--
View this message in context: 
http://cayenne.195.n3.nabble.com/paginated-queries-setPageSize-tp2779985p2780602.html
Sent from the Cayenne - User mailing list archive at Nabble.com.

Reply via email to