You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Thomas Götz (JIRA)" <ji...@apache.org> on 2012/05/22 22:21:41 UTC

[jira] [Created] (WICKET-4568) Caching of itemCount incorrect in AbstractPageableView

Thomas Götz created WICKET-4568:
-----------------------------------

             Summary: Caching of itemCount incorrect in AbstractPageableView
                 Key: WICKET-4568
                 URL: https://issues.apache.org/jira/browse/WICKET-4568
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 6.0.0-beta1, 1.5.6
            Reporter: Thomas Götz
            Priority: Minor


In AbstractPageableView.getItemCount() the result of dataprovider.size() is cached to avoid potentially expensive calls. While paging (e.g. from page 1 to page 2) dataprovider.size() is called twice anyhow. The reason for this is the call to clearCachedItemCount() in AbstractPageableView.onBeforeRender(). This call is obsolete as far as I can see, as clearCachedItemCount() is also called in AbstractPageableView.onDetach().

I tested this with the wicket-examples (DataTablePage) and the deletion of the call to clearCachedItemCount() in onBeforeRender() seems to have no side effects. Maybe someone could confirm this?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (WICKET-4568) Caching of itemCount incorrect in AbstractPageableView

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13288074#comment-13288074 ] 

Martin Grigorov commented on WICKET-4568:
-----------------------------------------

I am not sure about this proposed fix.

The commit that added this clear in #onBeforeRender() is:

commit e1bef00e2ff9e952915e2d1dc1ea0db6b581a8f5
Author: Igor Vaynberg <iv...@apache.org>
Date:   Tue Sep 4 04:03:43 2007 +0000

    clear cached item count before render. this value might be cached before render is started - for example when visibility of something is checked and getitemscount() is called - but the items might change between then and render time so it is not safe to cache it during that time period



So it seems there were some problem that needed this to be added.
                
> Caching of itemCount incorrect in AbstractPageableView
> ------------------------------------------------------
>
>                 Key: WICKET-4568
>                 URL: https://issues.apache.org/jira/browse/WICKET-4568
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.6, 6.0.0-beta1
>            Reporter: Thomas Götz
>            Priority: Minor
>         Attachments: WICKET-4568.patch, datatable-sample.zip
>
>
> In AbstractPageableView.getItemCount() the result of dataprovider.size() is cached to avoid potentially expensive calls. While paging (e.g. from page 1 to page 2) dataprovider.size() is called twice anyhow. The reason for this is the call to clearCachedItemCount() in AbstractPageableView.onBeforeRender(). This call is obsolete as far as I can see, as clearCachedItemCount() is also called in AbstractPageableView.onDetach().
> I tested this with the wicket-examples (DataTablePage) and the deletion of the call to clearCachedItemCount() in onBeforeRender() seems to have no side effects. Maybe someone could confirm this?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (WICKET-4568) Caching of itemCount incorrect in AbstractPageableView

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov updated WICKET-4568:
------------------------------------

    Attachment: datatable-sample.zip

Attach the quickstart from the mail discussion (http://markmail.org/thread/j45qbypch3xg2vxm).
                
> Caching of itemCount incorrect in AbstractPageableView
> ------------------------------------------------------
>
>                 Key: WICKET-4568
>                 URL: https://issues.apache.org/jira/browse/WICKET-4568
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.6, 6.0.0-beta1
>            Reporter: Thomas Götz
>            Priority: Minor
>         Attachments: WICKET-4568.patch, datatable-sample.zip
>
>
> In AbstractPageableView.getItemCount() the result of dataprovider.size() is cached to avoid potentially expensive calls. While paging (e.g. from page 1 to page 2) dataprovider.size() is called twice anyhow. The reason for this is the call to clearCachedItemCount() in AbstractPageableView.onBeforeRender(). This call is obsolete as far as I can see, as clearCachedItemCount() is also called in AbstractPageableView.onDetach().
> I tested this with the wicket-examples (DataTablePage) and the deletion of the call to clearCachedItemCount() in onBeforeRender() seems to have no side effects. Maybe someone could confirm this?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (WICKET-4568) Caching of itemCount incorrect in AbstractPageableView

Posted by "Thomas Götz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Götz updated WICKET-4568:
--------------------------------

    Attachment: WICKET-4568.patch

Patch added.
                
> Caching of itemCount incorrect in AbstractPageableView
> ------------------------------------------------------
>
>                 Key: WICKET-4568
>                 URL: https://issues.apache.org/jira/browse/WICKET-4568
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.6, 6.0.0-beta1
>            Reporter: Thomas Götz
>            Priority: Minor
>         Attachments: WICKET-4568.patch
>
>
> In AbstractPageableView.getItemCount() the result of dataprovider.size() is cached to avoid potentially expensive calls. While paging (e.g. from page 1 to page 2) dataprovider.size() is called twice anyhow. The reason for this is the call to clearCachedItemCount() in AbstractPageableView.onBeforeRender(). This call is obsolete as far as I can see, as clearCachedItemCount() is also called in AbstractPageableView.onDetach().
> I tested this with the wicket-examples (DataTablePage) and the deletion of the call to clearCachedItemCount() in onBeforeRender() seems to have no side effects. Maybe someone could confirm this?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (WICKET-4568) Caching of itemCount incorrect in AbstractPageableView

Posted by "bernard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13283220#comment-13283220 ] 

bernard commented on WICKET-4568:
---------------------------------

This appears to be a duplicate of WICKET-2532. I am glad a solution is at hand. Perhaps there is some value in re-evaluating WICKET-2532 to confirm that this patch does not create any conflicts with concerns raised there.
                
> Caching of itemCount incorrect in AbstractPageableView
> ------------------------------------------------------
>
>                 Key: WICKET-4568
>                 URL: https://issues.apache.org/jira/browse/WICKET-4568
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.6, 6.0.0-beta1
>            Reporter: Thomas Götz
>            Priority: Minor
>         Attachments: WICKET-4568.patch, datatable-sample.zip
>
>
> In AbstractPageableView.getItemCount() the result of dataprovider.size() is cached to avoid potentially expensive calls. While paging (e.g. from page 1 to page 2) dataprovider.size() is called twice anyhow. The reason for this is the call to clearCachedItemCount() in AbstractPageableView.onBeforeRender(). This call is obsolete as far as I can see, as clearCachedItemCount() is also called in AbstractPageableView.onDetach().
> I tested this with the wicket-examples (DataTablePage) and the deletion of the call to clearCachedItemCount() in onBeforeRender() seems to have no side effects. Maybe someone could confirm this?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira