Announcement

Collapse
No announcement yet.
X
  • 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?

    lkc

    #2
    Use the attribute "skipRowCount" on the operationBinding like here:
    Code:
    <operationBinding operationType="fetch" serverMethod="fetch" skipRowCount="true" >
    And set manually the total rows in the DMI fetch operation like here:
    Code:
            // in case the total rows was not calculated because a count sql was not performed
            // we use the "progressive" loading approach
            dsResponse.setTotalRows(
                    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
                    );

    Comment


      #3
      SC_SNAPSHOT-2012-03-20_v8.2p/PowerEdition

      I'm trying this exact approach, but in the server logs there's this INFO:
      Code:
      === 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.

      Comment


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

        Comment


          #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 http://forums.smartclient.com/showthread.php?t=17947
          where the select count(*) returns a number of rows which is different from the actual select distinct

          Comment


            #6
            found a bug which blocks me migrating to 8.3:
            http://forums.smartclient.com/showpost.php?p=84237&postcount=1

            Comment

            Working...
            X