No announcement yet.
  • Filter
  • Time
Clear All
new posts

  • Progressive loading - how to

    Hi there,

    I'm creating this thread hoping to aggregate info on this in one place. Information regarding this issue is scattered all over the forum but there is no single thread which says how to do it while retaining functionality available in SqlDataSource (sorting, filtering etc)

    Client side documentation regarding ResultSet states that there is nothing to be done clientside to implement this. You just have to return totalRows > endRow on the server.

    What if I want to use SQLDataSource and all its built in functionality (no custom queries etc.) but skip the phase where SQLDataSource sets totalRows on response. I know SQLDataSource may compute this value in many ways (resultSet scroll, LIMIT statement etc.) depending on database, driver etc.

    Is there any way I can disable built in counting and provide totalRows computed manually?


  • #2
    Use the attribute "skipRowCount" on the operationBinding like here:
    <operationBinding operationType="fetch" serverMethod="fetch" skipRowCount="true" >
    And set manually the total rows in the DMI fetch operation like here:
            // in case the total rows was not calculated because a count sql was not performed
            // we use the "progressive" loading approach
                    dsResponse.getEndRow() < dsRequest.getEndRow() ? // actual response contains more or less rows then requested ? 
                    dsResponse.getEndRow()  // less rows
                    :  dsRequest.getEndRow() + 2*(dsRequest.getEndRow() - dsRequest.getStartRow()) // more or equal number of rows - then return the actual number of rows plus 2 size of the page


    • #3

      I'm trying this exact approach, but in the server logs there's this INFO:
      === 2012-04-04 17:22:46,922 [c-64] INFO  SQLDataSource - [builtinApplication.SERVIZI_fetch] Skipping row count query - Row count will be obtained by traversing the entire dataset
      and actually it traverse the entire dataset. Why? I've also disabled sorting on the grid.


      • #4
        progressiveLoading is now built in - see operationBinding.progessiveLoading.


        • #5
          I see it's a 8.3d feature...I'll try it.
          I want to use it as a workaround for this problem I have with distinct
          where the select count(*) returns a number of rows which is different from the actual select distinct


          • #6
            found a bug which blocks me migrating to 8.3: