Microsoft Knowledge Base Email Alertz

A workflow rule that contains a step to send an e-mail message causes a deadlock when many instances of the workflow rule are executed at the same time in Microsoft Dynamics CRM 4.0

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 981053 - Last Review: May 19, 2010 - Revision: 3.0

A workflow rule that contains a step to send an e-mail message causes a deadlock when many instances of the workflow are executed at the same time in Microsoft Dynamics CRM 4.0

SYMPTOMS

Consider the following scenario. You create a workflow rule in Microsoft Dynamics CRM 4.0. The workflow rule contains a step to send an e-mail message. Then, you perform actions that cause many instances of the workflow to be executed at the same time. In this scenario, you notice that some instances of the workflow fail because of a deadlock. Additionally, you receive the following error message:
A SQL Server error occurred. Try this action again. If the problem continues, check the Microsoft Dynamics CRM Community for solutions or contact your organization's Microsoft Dynamics CRM Administrator. Finally, you can contact Microsoft Support.

Note If you enable platform tracing, you also receive an error message that resembles the following:
Crm Exception: Message: , ErrorCode: -2147204784, InnerException: System.Data.SqlClient.SqlException: Transaction (Process ID 69) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.HasMoreRows()
at System.Data.SqlClient.SqlDataReader.ReadInternal(Boolean setTimeout)
at System.Data.SqlClient.SqlDataReader.Read()
at Microsoft.Crm.BusinessEntities.BusinessProcessObject.FillEntityCollectionFromDataReader(BusinessEntityCollection entities, IDataReader reader, EntityExpression entityExp, PagingHelper pagingHelper, ExecutionContext context)
at Microsoft.Crm.BusinessEntities.BusinessProcessObject.DoRetrieveMultiple(BusinessEntityCollection entities, EntityExpression entityExp, ExecutionContext context)
at Microsoft.Crm.BusinessEntities.BusinessProcessObject.RetrieveMultiple(EntityExpression entityExpression, ExecutionContext context)
at Microsoft.Crm.ObjectModel.CommunicationActivityServiceBase.RetrieveCommunicationParties(BusinessEntityMoniker moniker, CommunicationActivity activity, ExecutionContext context)
at Microsoft.Crm.ObjectModel.CommunicationActivityServiceBase.Retrieve(BusinessEntityMoniker moniker, EntityExpression entityExpression, ExecutionContext context)
at Microsoft.Crm.ObjectModel.EmailService.Send(Guid emailId, Boolean issueSend, String trackingToken, ExecutionContext context) at Microsoft.Crm.ObjectModel.TemplateService.SendEmailFromTemplate(Guid templateId, Int32 regardingType, Guid regardingId, IBusinessEntity targetInfo, ExecutionContext context)

RESOLUTION

This problem is fixed in the latest cumulative update rollup for Microsoft Dynamics CRM 4.0.
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
949256  (http://kbalertz.com/Feedback.aspx?kbNumber=949256/ ) Microsoft Dynamics CRM 4.0 updates and hotfixes

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756  (http://kbalertz.com/Feedback.aspx?kbNumber=322756/ ) How to back up and restore the registry in Windows

To enable this hotfix on the computer that is running Microsoft Dynamics CRM 4.0, follow these steps:
  1. Under the
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM\
    registry subkey on the Microsoft Dynamics CRM server, add the following DWORD registry entry:
    SDKSerializeSendEmailAPI
  2. Set the value of the registry entry that you just added to 1.

Note This problem was originally fixed in Update Rollup 10 for Microsoft Dynamics CRM 4.0.
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
979347  (http://kbalertz.com/Feedback.aspx?kbNumber=979347/ ) Update Rollup 10 for Microsoft Dynamics CRM 4.0 is available

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684  (http://kbalertz.com/Feedback.aspx?kbNumber=824684/ ) Description of the standard terminology that is used to describe Microsoft software updates


For more information about Microsoft Business Solutions CRM software hotfix and update package terminology, click the following article number to view the article in the Microsoft Knowledge Base:
887283  (http://kbalertz.com/Feedback.aspx?kbNumber=887283/ ) Microsoft Business Solutions CRM software hotfix and update package naming standards

APPLIES TO
  • Microsoft Dynamics CRM 4.0
Keywords: 
kberrmsg kbfix kbqfe kbsurveynew kbmbsmigrate kbexpertiseinter KB981053
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate