Multiple Data Sources block each other randomly

6 posts, 0 answers
  1. Jayaram Krishnan
    Jayaram Krishnan avatar
    16 posts
    Member since:
    Apr 2017

    Posted 08 Nov 2017 Link to this post

    Hi,

    I have datasource1 which would return result immediately is bound to grid1 , and datasource2 which uses a long running query (~10 seconds) bound to grid2. Both grids are on the same page.

    here is the normal flow from chrome console:

    datasource1 request started
    datasource2  request started
    datasource1  request ended
    datasource2  request ended

    But sometimes datasource2  would block datasource1 (request status = 'Pending' in chrome dev tab), and would return before datasource1:

     

    datasource1 request started
    datasource2  request started
    datasource2  request ended
    datasource1  request ended

    Since datasource2  is taking 10seconds, datasource1 would not return until datasource2 is done with request.

    to troubleshoot the issues I spread my backend actions (MVC actions) to different controllers and removed any reference to session/cockie but that did not help.

    Thank you.

    Madani

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2218 posts

    Posted 10 Nov 2017 Link to this post

    Hi Krishnan,

    The Grid`s DataSource will make standard AJAX requests and the behavior that you are describing is expected. If you want to ensure that the second Grid will request the data after the first Grid data is received, you can set the AutoBind property of the second Grid to false and call the "read" method of its DataSource within the dataBound event of the first Grid (with a global flag variable to ensure if the logic is executed only once, unless you need to execute it after each request of the first grid).

    Hope this helps.


    Regards,
    Konstantin Dikov
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Jayaram Krishnan
    Jayaram Krishnan avatar
    16 posts
    Member since:
    Apr 2017

    Posted 12 Nov 2017 in reply to Konstantin Dikov Link to this post

    Thanks Konstantin,

    I am not caring about which data source return before the other.I want to ensure that data sources can request data at the same time (after document.ready is called).My understanding is that data sources run asynchronous, meaning that multiple request can run at the same time without any blocking.Are you saying that this is not possible ?

    Madani

     

  4. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2218 posts

    Posted 15 Nov 2017 Link to this post

    Hello Madani,

    The requests are async and the Grid will start rendering the data on the success of the AJAX request. However, the actual rendering will not be an async operation and the order of which the Grid data will be rendered will depend on which of the requests will be returned first:

    Regards,
    Konstantin Dikov
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Jayaram Krishnan
    Jayaram Krishnan avatar
    16 posts
    Member since:
    Apr 2017

    Posted 21 Nov 2017 in reply to Konstantin Dikov Link to this post

    I am not satisfied with your answer.I am talking about one data source request blocking another data source request regardless of the grid control.We all understand that one data source would return data before the other, but the problem i am describing here is that one data source read request is blocking another data source read request.The second data source read request is not initiated until the first one finish fetching data.Please see the attached image where the red line describes the delay caused by the blocking.

    Thanks

     

  6. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2218 posts

    Posted 21 Nov 2017 Link to this post

    Hi Madami,

    If you inspect the "Network" tab in the browser while running the dojo example from my previous post you will notice that both requests are running simultaneously. I am attaching a screenshot from the dojo.

    On a side note, your first post described different behavior and different problem from the one shown in the last image. Could you please elaborate how you are determining the current flow of the requests?
     

    Regards,
    Konstantin Dikov
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top