Announcement

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

    Next fetchData() not triggered when end of ListGrid is reached

    Hello,

    I'm trying to use the progressive loading pattern with the SQL limit query (for Oracle, with sql.oracle.supportsSQLLimit: true), it appears that the next fetchData() is not triggered after the end of the ListGrid is reached.

    Code:
    <?xml version="1.0"?>
    <DataSource ID="hugeTable" dataFormat="iscServer" serverType="sql" tableName="T_HUGE_TABLE" sqlPaging="sqlLimit" skipRowCount="true"> 
    	<fields>
    		<field...
    Here is my ListGrid:
    Code:
    final dataSource = DataSource.get("hugeTable");
    final ListGrid listGrid = new ListGrid();
    listGrid.setWidth100();
    listGrid.setHeight100();
    listGrid.setDataSource(dataSource);
    listGrid.setAutoFetchData(Boolean.TRUE);
    And here are the logs which show that it works well:
    Code:
    === 2014-10-02 14:26:22,367 [l0-0] DEBUG SQLDriver - [builtinApplication.hugeTable_fetch] About to execute SQL query in 'DEFAULT' using connection '1406585832'
    === 2014-10-02 14:26:22,367 [l0-0] INFO  SQLDriver - [builtinApplication.hugeTable_fetch] Executing SQL query on 'DEFAULT': SELECT COUNT(*) FROM T_EXANE_EXECUTED_ORDERS WHERE ('1'='1')
    === 2014-10-02 14:26:22,592 [l0-0] INFO  SQLDataSource - [builtinApplication.hugeTable_fetch] Row count query found 1712874 rows, which exceeds the DataSource's progressiveLoadingThreshold of 200000.  Switching to progressive loading mode.
    === 2014-10-02 14:26:22,592 [l0-0] DEBUG SQLDataSource - [builtinApplication.hugeTable_fetch] Using SQL Limit query
    === 2014-10-02 14:26:22,592 [l0-0] DEBUG SQLDataSource - [builtinApplication.hugeTable_fetch] SQL windowed select rows 0->75, result size 76. Query: SELECT * FROM (SELECT /*+ FIRST_ROWS(76) */ a.*, rownum myrownum FROM (SELECT T_HUGE_TABLE.TITI, T_HUGE_TABLE.TOTO FROM T_HUGE_TABLE WHERE ('1'='1')) a where rownum <=77) WHERE myrownum >= 1
    === 2014-10-02 14:26:22,592 [l0-0] DEBUG SQLDataSource - [builtinApplication.hugeTable_fetch] SQL windowed select rows 0->75, result size 76. Query: SELECT * FROM (SELECT /*+ FIRST_ROWS(76) */ a.*, rownum myrownum FROM (SELECT T_HUGE_TABLE.TITI, T_HUGE_TABLE.TOTO FROM T_HUGE_TABLE WHERE ('1'='1')) a where rownum <=77) WHERE myrownum >= 1
    === 2014-10-02 14:26:22,646 [l0-0] DEBUG SQLDriver - Freeing SQLDriver dbConnection 1406585832
    === 2014-10-02 14:26:22,646 [l0-0] DEBUG SQLConnectionManager - About to close ISCPoolableConnection with hashcode "1406585832"
    === 2014-10-02 14:26:22,646 [l0-0] DEBUG PoolableSQLConnectionFactory - Executing pingTest 'select 1 from dual' on connection 1406585832
    Please note that if I disable the SQL limit support for Oracle, the JDBC Scroll is used and the next fetchData() is called (but in my case, I can't use because of an issue with the Oracle driver, and I need to use the rownum trick instead).

    I use SmartGWT 4.1-p2014102.

    Many thanks for your help!

    Cheers,
    A.

    #2
    Hello!

    Do you have any clue / idea on this issue?

    Thanks,
    A.

    Comment


      #3
      I was trying to reproduce your issue, but without success.

      Could you please enable DEBUG log level on RPCManager to see what is sent back to the client after initial fetch? I know it will be huge, you may strip the "data" off.

      Comment


        #4
        Hello,

        I'm afraid that it's not what you expected :)

        There is only one RPC call when I display the ListGrid for the first time: when I reach the bottom of the scrollbar of my ListGrid, no fetch is invoked.

        Code:
        === 2014-10-09 10:41:35,167 [l0-6] DEBUG RPCManager - Processing 1 requests.
        === 2014-10-09 10:41:35,184 [l0-6] DEBUG RPCManager - Request #1 (DSRequest) payload: {
            criteria:{
            },
            operationConfig:{
                dataSource:"hugeTable",
                operationType:"fetch",
                textMatchStyle:"substring"
            },
            startRow:0,
            endRow:75,
            componentId:"isc_ListGrid_0",
            appID:"builtinApplication",
            operation:"hugeTable_fetch",
            oldValues:{
            }
        }
        === 2014-10-09 10:41:38,485 [l0-6] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
        === 2014-10-09 10:41:38,486 [l0-6] DEBUG RPCManager - non-DMI response, dropExtraFields: false
        FI: I also tried with the patch of the 2014/10/05, but I encounter the same behavior.

        Thanks,
        A.

        Comment


          #5
          I'm not sure if it can help, but I can send you my entire Eclipse project if necessary (you may just need to have an Oracle database and a huge table)

          A.

          Comment


            #6
            Thanks for your reply, no need to send your application, at least not now. And right, this is not what I expected, but may be I asked for it wrong way :)
            Can you open Console and in RPC tab enable "Track RPCs" checkbox, then select RPC call that does initial fetch and show us what appears in "Raw Response" section at the right-bottom of the screen. Something like this:
            Code:
            {
                affectedRows:0, 
                data:[
                    ..... HUGE AMOUNT OF DATA .....
                ], 
                endRow:76, 
                invalidateCache:false, 
                isDSResponse:true, 
                operationType:"fetch", 
                queueStatus:0, 
                startRow:0, 
                status:0, 
                totalRows:95
            }

            Comment


              #7
              No worries :)

              Here is what you asked for:
              Code:
              [
                  {
                      affectedRows:0, 
                      data:[
                          {
                            ...
                          }
                      ], 
                      endRow:77, 
                      invalidateCache:false, 
                      isDSResponse:true, 
                      operationType:"fetch", 
                      queueStatus:0, 
                      startRow:0, 
                      status:0
                  }
              ]
              I hope it helps,
              A.

              Comment


                #8
                Hello,

                Do you want me to send you my Eclipse project? It may be easier to debug...

                Thanks,
                A.

                Comment


                  #9
                  This is fixed now, you may download next nightly build (2014-10-14) and try it out.

                  It would be great if you give us feedback how this works for you after the fix.

                  Comment


                    #10
                    I just download the latest patch to try and it seems to work well.

                    Thanks a lot! We are definitely going to use it.
                    A.

                    Comment

                    Working...
                    X