[ 
https://issues.apache.org/jira/browse/WICKET-6470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16652499#comment-16652499
 ] 

Jezza commented on WICKET-6470:
-------------------------------

Sadly, the IDataProvider interface does say anything about if it's going to be 
called multiple times per request.
You're basically just seeing a side-effect of the AbstractPageableView trying 
to help out by caching the value.
And when you swap them around, the cache value is reset because the 
AbstractPageableView resets the value as it starts to render, because the value 
might have changed between construction time and rendering time.
https://github.com/apache/wicket/commit/e1bef00e2ff9e952915e2d1dc1ea0db6b581a8f5

I'd say, if the operation is expensive enough, build your data provider around 
providing consistent results for a request, caching the necessary data, and 
then onDetach, just toss it.

> If AjaxPagingNavigator is added before table, count is called twice
> -------------------------------------------------------------------
>
>                 Key: WICKET-6470
>                 URL: https://issues.apache.org/jira/browse/WICKET-6470
>             Project: Wicket
>          Issue Type: Bug
>            Reporter: Kamil
>            Priority: Major
>         Attachments: showcase-ajaxPagingNavigator.zip
>
>
> 1) Run "shouldCallCountOnce" test
> 2) Switch "EntityTable" lines 29 and 30
> 3) Run the test again.
> Count is rather expensive operation, so it should not be called twice. 
> Despite this behavior doesn't look consistent nor deterministic...



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to