Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

SQL timeout expired in CRM 2015 Execute Multiple Request

(0) ShareShare
ReportReport
Posted on by 7 Super User 2024 Season 1

Hi,

I am trying to create around 7 records using ExecuteMultiple Request in CRM 2015 plugin as in the below code. But I am getting "SQL timeout expired" fault in the response. Can any one help to solve this issue, please?

ExecuteMultipleRequest multipleRequest = new ExecuteMultipleRequest {

      Settings = new ExecuteMultipleSettings {

            ContinueOnError = false,

            ReturnResponses = true

      },

      Requests = new OrganizationRequestCollection()

};

foreach (var entity in entityCollection.Entities)
{
      multipleRequest.Requests.Add(new CreateRequest { Target = entity});
}
ExecuteMultipleResponse responseWithResults = (ExecuteMultipleResponse)Service.Execute(multipleRequest);

foreach (var responseItem in responseWithResults.Responses)
{
      if (responseItem.Fault != null)
             tracingService.Trace("Error: " + responseItem.Fault.Message);
}

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: SQL timeout expired in CRM 2015 Execute Multiple Request

    For me this happens only when request run in plugin.

    If I run in separate console app everything executes successfully.

  • Charan Raju C R Profile Picture
    Charan Raju C R 7 Super User 2024 Season 1 on at
    RE: SQL timeout expired in CRM 2015 Execute Multiple Request

    Nope, Brandon. I'm facing this issue only in Dev environment when I register the plugin in Synchronous mode. So, as a temporary fix, I registered this plugin in Async mode.

  • RE: SQL timeout expired in CRM 2015 Execute Multiple Request

    Charan,

    Have you found a solution for this at all? I am running into the same issue. Thanks.

  • Charan Raju C R Profile Picture
    Charan Raju C R 7 Super User 2024 Season 1 on at
    RE: SQL timeout expired in CRM 2015 Execute Multiple Request

    Getting the same error even for a single record.

  • RE: SQL timeout expired in CRM 2015 Execute Multiple Request

    What happens if you create a single thread with one, two or five records in the executemultiplerequest?

    Regards

  • Charan Raju C R Profile Picture
    Charan Raju C R 7 Super User 2024 Season 1 on at
    RE: SQL timeout expired in CRM 2015 Execute Multiple Request

    Hi Joe,

    No. But its working fine when I register the plugin in Asynchronous mode or create the records individually.

  • Joe Gill Profile Picture
    Joe Gill on at
    RE: SQL timeout expired in CRM 2015 Execute Multiple Request

    Hi Charan,

    Do you any workflows or plugins being triggered on the creation of the records?

    Joe

  • Charan Raju C R Profile Picture
    Charan Raju C R 7 Super User 2024 Season 1 on at
    RE: SQL timeout expired in CRM 2015 Execute Multiple Request

    This error details I got from CRM Server Traces.

    If I register the plugin in Asynchronous mode, its working fine. I was calling the Execute Multiple code inside the for loop. If I am correct, we can make only two Execute Multiple calls(2 threads) at a time. Since it was inside the for loop, next Execute Multiple was being called before completing the previous two threads.

    Edited: Still facing the same problem even if I create a single thread for 600 records :(

  • RE: SQL timeout expired in CRM 2015 Execute Multiple Request

    Hi,

    I don't know if it matters in this case, but is that the error from the tracelog that you get from the server (https://support.microsoft.com/en-us/kb/907490) or from the errortrace of the executemultiple?

    Ït's very strange that a single action gets a sql timeout, can you see anything in some server logs on the SQL?

    Regards

  • Charan Raju C R Profile Picture
    Charan Raju C R 7 Super User 2024 Season 1 on at
    RE: SQL timeout expired in CRM 2015 Execute Multiple Request

    Below is the screenshot of the error message in tracer. Dint find much.

    Execute_5F00_Multiple_5F00_Error.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,703 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,433 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans