Re: DataView size() iterator() call order issue

2008-03-28 Thread Johan Compagner
:[EMAIL PROTECTED] Sent: Thursday, March 27, 2008 12:02 PM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue forgot: public class MYSizeCachingDataProvider ... { public void detach() { size = null; resultset = null; } } On 3/27/08

RE: DataView size() iterator() call order issue

2008-03-28 Thread Hoover, William
and incorporate the code from the legacy JSF application. Thanks for your time! -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED] Sent: Friday, March 28, 2008 8:59 AM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue i already mentioned

RE: DataView size() iterator() call order issue

2008-03-27 Thread Hoover, William
:[EMAIL PROTECTED] Sent: Wednesday, March 26, 2008 3:27 PM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue On Wed, Mar 26, 2008 at 11:37 AM, Hoover, William [EMAIL PROTECTED] wrote: 2) Although AbstractPageableView does ensure the cached item count is used

RE: DataView size() iterator() call order issue

2008-03-27 Thread Hoover, William
: DataView size() iterator() call order issue If we are caching the data as well as the size then we get that from the cache. The call that gets data/size can check the cache. If it is not cached then make the query call to get it. public final int size

Re: DataView size() iterator() call order issue

2008-03-27 Thread Johan Compagner
] Sent: Wednesday, March 26, 2008 3:27 PM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue On Wed, Mar 26, 2008 at 11:37 AM, Hoover, William [EMAIL PROTECTED] wrote: 2) Although AbstractPageableView does ensure the cached item count is used before calling

RE: DataView size() iterator() call order issue

2008-03-27 Thread Hoover, William
, 2008 7:49 AM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue and how do we know the difference? You as a developer know it, we dont know it as a framework, just cache it in your dataprovider or wrap in in a caching data provider. Why is that so difficult johan

RE: DataView size() iterator() call order issue

2008-03-27 Thread Hoover, William
Message- From: Hoover, William [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2008 7:55 AM To: users@wicket.apache.org Subject: RE: DataView size() iterator() call order issue The difference is that in the deletion scenario the state of the data has changed. In the pagination scenario

Re: DataView size() iterator() call order issue

2008-03-27 Thread Johan Compagner
: Thursday, March 27, 2008 7:49 AM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue and how do we know the difference? You as a developer know it, we dont know it as a framework, just cache it in your dataprovider or wrap in in a caching data provider. Why

RE: DataView size() iterator() call order issue

2008-03-27 Thread Hoover, William
] Sent: Thursday, March 27, 2008 7:49 AM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue and how do we know the difference? You as a developer know it, we dont know it as a framework, just cache it in your dataprovider or wrap in in a caching data

Re: DataView size() iterator() call order issue

2008-03-27 Thread Johan Compagner
- From: Johan Compagner [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2008 8:12 AM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue no cache the size. We first have to have the size to be able to give you the offset and count params. And depending

RE: DataView size() iterator() call order issue

2008-03-27 Thread Hoover, William
Can you post code for an example data provider that would KNOW how to cache the size? -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2008 10:47 AM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue no you

RE: DataView size() iterator() call order issue

2008-03-27 Thread Hoover, William
). -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2008 11:36 AM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue If you are iterating over a list that can be changed by all kinds of different users Then you cant really

Re: DataView size() iterator() call order issue

2008-03-27 Thread Martijn Dashorst
Message- From: Johan Compagner [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2008 11:36 AM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue If you are iterating over a list that can be changed by all kinds of different users Then you cant

Re: DataView size() iterator() call order issue

2008-03-27 Thread Martijn Dashorst
] Sent: Thursday, March 27, 2008 11:36 AM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue If you are iterating over a list that can be changed by all kinds of different users Then you cant really cache it If you are iterating over

RE: DataView size() iterator() call order issue

2008-03-26 Thread Hoover, William
see below... -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Monday, March 24, 2008 5:13 PM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue how are we going to cover these usecases: * pagination toolbar needs to call

Re: DataView size() iterator() call order issue

2008-03-26 Thread Johan Compagner
, March 24, 2008 5:13 PM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue how are we going to cover these usecases: * pagination toolbar needs to call dataprovier.size() to figure out how many total records there are. at this point the toolbar doesnt know

RE: DataView size() iterator() call order issue

2008-03-26 Thread Hoover, William
and the count. The problem is that the first and count are unknown until the iterator method is called. -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 26, 2008 10:54 AM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue

Re: DataView size() iterator() call order issue

2008-03-26 Thread Johan Compagner
Compagner [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 26, 2008 10:54 AM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue yes you can cache those values IDataProvider does extends IDetachable and in detach() you can clear those values. On Wed, Mar 26

RE: DataView size() iterator() call order issue

2008-03-26 Thread Hoover, William
it does now). Is there currently a way to do that? -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 26, 2008 12:12 PM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue default behavior? what do you mean

Re: DataView size() iterator() call order issue

2008-03-26 Thread Johan Compagner
: Wednesday, March 26, 2008 12:12 PM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue default behavior? what do you mean? IDataprovider is an interface, how can this have default behavior You can cache your results if you want So if you want in the size() call

Re: DataView size() iterator() call order issue

2008-03-26 Thread Igor Vaynberg
PROTECTED] wrote: see below... -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Monday, March 24, 2008 5:13 PM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue how are we going to cover these usecases: * pagination

RE: DataView size() iterator() call order issue

2008-03-26 Thread Hoover, William
Compagner [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 26, 2008 12:34 PM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue dont know if we really can do that I dont know if the size() call really always in the same request returns the same.. You

RE: DataView size() iterator() call order issue

2008-03-26 Thread Hoover, William
. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 26, 2008 1:32 PM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue we are getting off track though. suppose class result { int size; iterator data } and idataprovider

Re: DataView size() iterator() call order issue

2008-03-26 Thread Igor Vaynberg
On Wed, Mar 26, 2008 at 11:37 AM, Hoover, William [EMAIL PROTECTED] wrote: 2) Although AbstractPageableView does ensure the cached item count is used before calling the data provider size() in getRowCount(), the cached item count is cleared in onBeforeRender() before the call is made to

RE: DataView size() iterator() call order issue

2008-03-24 Thread Hoover, William
@wicket.apache.org Subject: Re: DataView size() iterator() call order issue knowing the size and the window together seems like a ui requirement, it is a bit strange to me that you have it inside a dao which should cater to business logic. eg, as far as i know there is no single db operation

Re: DataView size() iterator() call order issue

2008-03-24 Thread Igor Vaynberg
or not it will make the expensive call for the results. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Friday, March 21, 2008 2:44 PM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue knowing the size and the window together

DataView size() iterator() call order issue

2008-03-21 Thread Hoover, William
When using DataView/IDataProvider size() is called before iterator(int first, int count) causing calls to DAOs to be duplicated. Our current framework that is internally using Hibernate allows one call to be made to a DAO that returns both the total result size and the actual records (based off

Re: DataView size() iterator() call order issue

2008-03-21 Thread Igor Vaynberg
knowing the size and the window together seems like a ui requirement, it is a bit strange to me that you have it inside a dao which should cater to business logic. eg, as far as i know there is no single db operation that will produce both, so you are still doing two calls inside the dao. also

RE: DataView size() iterator() call order issue

2008-03-21 Thread Dan Kaplan
To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue knowing the size and the window together seems like a ui requirement, it is a bit strange to me that you have it inside a dao which should cater to business logic. eg, as far as i know there is no single db operation

Re: DataView size() iterator() call order issue

2008-03-21 Thread Igor Vaynberg
- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Friday, March 21, 2008 11:44 AM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue knowing the size and the window together seems like a ui requirement, it is a bit strange to me that you have

RE: DataView size() iterator() call order issue

2008-03-21 Thread Dan Kaplan
PROTECTED] Sent: Friday, March 21, 2008 1:27 PM To: users@wicket.apache.org Subject: Re: DataView size() iterator() call order issue yes you can technically mangle it into a single query and get a single result set back, but where is your savings? the database is still doing two operations

Re: DataView size() iterator() call order issue

2008-03-21 Thread Igor Vaynberg
Subject: Re: DataView size() iterator() call order issue yes you can technically mangle it into a single query and get a single result set back, but where is your savings? the database is still doing two operations... not to mention once you include any sort of filtering you have to repeat