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

Article translations Article translations
Article ID: 981053 - View products that this article applies to.
Expand all | Collapse all

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 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 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 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 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 Microsoft Business Solutions CRM software hotfix and update package naming standards

Properties

Article ID: 981053 - Last Review: May 19, 2010 - Revision: 3.0
APPLIES TO
  • Microsoft Dynamics CRM 4.0
Keywords: 
kberrmsg kbfix kbqfe kbsurveynew kbmbsmigrate kbexpertiseinter KB981053

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com