Select to view content in your preferred language

Multiple querytasks

825
4
05-20-2010 02:40 PM
DanDulan
Emerging Contributor
I am working on a Silverlight 4 app (Esri Silverlight 2.0 API) and I am trying to figure out how to query 20+ layers (in parallel) and still have good performance.( I have to use the parcel geometry to query these layers and get the geometry and some attributes back).
What is the best pattern for this type of functionality?
Can I use multitreading?
There are any service cfg settings to improve the performance?
In Fiddler, I noticed that only for the first two queries the ServerGotRequest time is identical, then the next one after the first query is proccesed.
Can we send more than two queries simultaneously?
Also, It is possible to use the querytask on the server side?
0 Kudos
4 Replies
dotMorten_esri
Esri Notable Contributor
The browser doesn't allow to perform more thant two requests simultanously to one single domain. This is per the RFC specification (Some browsers do it anyway though).
However, if you are all about performance, having to perform 20 queries to complete a task, is probably where you should stop and rethink what you are doing.

If it's because you need to do a drilldown through all the layers in one service, you should probably take a look at the IdentifyTask instead.
0 Kudos
DanDulan
Emerging Contributor
Thanks Morten!

One of the requirements of my app is to build a parcel report, so I have to query 20+ layers to get the attributes and the geometries.
You are right, identify task should be my  first choice.....but unfortunately it takes the same amount of time as 20 different querytasks.
Because any individual querytask takes  0.1 to 0.2 seconds,  it seems logical to try to send all of them and get the total response time under 1 second.
Today, I have used the new client HTTP stack and I got 6 simultaneously connections.
I know you can change the maxconnection for wcf web services. Is there any configuration setting like this for the querytask?
Can we set the maxconnection in rest.config?

Thanks,
Dan Dulan
0 Kudos
DanDulan
Emerging Contributor
Never mind!
I found a solution for now.
Basically I had to make the queries in two steps, first 10 queries during the parcel search and the next 15 queries during the report generation.
Now, the user doesn't have to wait more than one second.
I will investigate this later, when ESRI will release the 2.0.
0 Kudos
BrandonCales
Regular Contributor
Can you share your code.  All I'm trying to do is query 2 separate parcel layers and have them both populate the same graphics layer and data grid. I have one query working perfectly, but QueryTask apparently doesn't like multiple layers like FindTask does, and FindTask is one attribute, in which I search several.
0 Kudos