Domanda

Delay in initial retrieving of xml data using XRM

I am using this xml query

   <fetch mapping='logical'>      <entity name='de_municipality'>           <order attribute='de_name' ascending='true' />            <attribute name='de_municipalityid'/>           <attribute name='de_name'/>           </entity>   </fetch>"

For the Fetch method of XRM. It is taking around 10 seconds to get the result (though there are only limited number of entities).

ResultsXml = dc.UsingService(service => (string)service.Fetch(oFetchXml.InnerXml));

This is line of code is making the delay!!!

Next time execution will give results in 120 milli seconds.

I have experimented this query with the CRM4, the delay is only 200 milli seconds for all the attempts.

Any tips or trick or analysis method will be appreciated.

È stato utile?

Soluzione

I got a reply from MSDN like this...

Hi Vinu,

we made a call to Microsoft about this issue and it was confirmed to be a design problem. This shouldn't be an issue anymore with CRM 2011.

Our current workaround is to keep the web application wich consumes the DataContext alive for as long as possible, because once the Metadata is cached the call does not occur any further.

Be careful - the DataContext not only caches the Metadata but also the content itself - such as attributes and relationships. If you want to refresh these you can clear the cache partially for specific entities as described here: Empty CRM Client DataContext cache

Kind regards

Markus


Markus Wolff Senior Software Developer CRM Systems Gruner & Jahr & Co. KG Hamburg, Germany

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top