0 Replies Latest reply on Apr 26, 2012 7:44 AM by volkov.d

    ExtendedDataTable and JPADataModel too many DB requests

    volkov.d

      Hello!

       

      I have my own implementation of JPADataModel which I use with ExtendedDataTable and ajaxLoading(clientRows="100" ). The problem is that the walk method of DataModel is invoked about 10 times in every request with different Ranges.

      This is log of walk invokation Ranges I have collected during one request:

       

      First row: 0  maxRows: 15

      First row: 0  maxRows: 15

      First row: 0  maxRows: 15

      First row: 0  maxRows: 15

      First row: 0  maxRows: 11

      First row: 15  maxRows: 11

      First row: 0  maxRows: 11

      First row: 15  maxRows: 11

      First row: 11  maxRows: 15

      First row: 11  maxRows: 15

       

      Different ranges makes it quite difficult to cache.

       

      Could someone give me a hint how to prevent multiple DB requests, or is it a bug I should post in RF Jira?

       

      I have reproduced this behavior in RF showcase with ExtendedDataTable example:

       

       

            <rich:extendedDataTable value="#{personBean.dataModel}"
                  var="record" id="table" frozenColumns="2"
                  style="height:300px; width:500px;" selectionMode="none"
                  clientRows="#{carsBean.clientRows}">
                  
                  <ui:include src="jpaColumn.xhtml">
                      <ui:param name="bean" value="#{personBean}" />
                      <ui:param name="property" value="name" />
                  </ui:include>
                  <ui:include src="jpaColumn.xhtml">
                      <ui:param name="bean" value="#{personBean}" />
                      <ui:param name="property" value="surname" />
                  </ui:include>
                  <ui:include src="jpaColumn.xhtml">
                      <ui:param name="bean" value="#{personBean}" />
                      <ui:param name="property" value="email" />
                  </ui:include>
              </rich:extendedDataTable>