Alex
Alex

Reputation: 211

ExecuteMultipleRequest - SQL Timeout Expired - Microsoft Dynamics CRM 2015


During development of a synchronous plug-in for "Microsoft Dynamics CRM 2015 Update 1 Online" I use ExecuteMultipleRequest to create multiple entity records. When I test the plug-in in CRM an exception message appears which says "SQL Timeout expired".
If I replace ExecuteMultipleRequest with service.Create(...) called in a loop it works fine. It also works fine if I change the type of the plug-in from synchronous to asynchronous without replacement of ExecuteMultipleRequest.
Does someone know what can be a cause of a SQL Timeout issue in a synchronous plug-in?
Thank you.

Upvotes: 1

Views: 3668

Answers (2)

Daryl
Daryl

Reputation: 18895

I would not recommend using the ExecuteMultipleRequest from within a plugin. You're already on the server at that point in time, and therefore don't get any performance benefit from using the ExecuteMultipleRequest (From my own testing, I have not seen a performance improvement, if you have data that says otherwise, would love to see it). You also run into the potential issue of having the request fail, since CRM limits the number of concurrent ExecuteMultipleRequests that are executing.

Upvotes: 0

Kevin Hendricks
Kevin Hendricks

Reputation: 785

Dynamics CRM online is limited to the default setting of 2 minutes before a timeout occurs. This means larger processes in a single plugin operation are prone to timeout.

Below is a list of options:

  • Review your code to improve performance
  • Move the heavy operation from the parent to the child entity record
  • Create a Queue entity with a type and operation which will fire the operation for each entity record individually

Good luck

Cheers

Upvotes: 2

Related Questions