This is a migrated thread and some comments may be shown as answers.

Multiple Data Sources block each other randomly

5 Answers 364 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Jayaram Krishnan
Top achievements
Rank 1
Jayaram Krishnan asked on 08 Nov 2017, 09:42 AM

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

5 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 10 Nov 2017, 07:39 AM
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.
0
Jayaram Krishnan
Top achievements
Rank 1
answered on 12 Nov 2017, 06:09 AM

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

 

0
Konstantin Dikov
Telerik team
answered on 15 Nov 2017, 07:24 AM
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.
0
Jayaram Krishnan
Top achievements
Rank 1
answered on 21 Nov 2017, 12:45 PM

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

 

0
Konstantin Dikov
Telerik team
answered on 21 Nov 2017, 01:18 PM
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.
Tags
Data Source
Asked by
Jayaram Krishnan
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Jayaram Krishnan
Top achievements
Rank 1
Share this question
or