Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Unhandled Exception with Custom workflow - Dynamics CRM CRM 2015

$
0
0

Dear Experts,

Recently I have faced a strange issue in Dynamics CRM 2015 On-Premise instance. 

Functionality:

We have a custom workflow that schedule to run daily, this will update an Entity1 record status. 

On Entity1 Status update, we have plug-in to update Entity2. 

On Entity2 Status update, we have plug-in to update Entity3.

On Entity3 Status update, we have plug-in to update Entity4 (Master Entity).

Basically, 3 level of Plug-ins. All these plug-ins registered as Synchronous. 

In this scenario, we have only 1 Master record and all the 55 records are trying to update this one record. 

Issue:

Custom workflow ran on 55 records at a time, first 15 records were completed as successful and other records went to waiting stage. Server Event viewer logged different types of errors and some of the errors summary as below:

Initial Error:

ServerName; CrmAsyncService.exe (1908); ACF75705; execution time:00:01:25.4526639/ServerName; Microsoft.Crm.Sandbox.HostService.exe (2764); D1FF8028; execution time:00:01:25.4526639; Plug-in Name, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd55c642b9a72843:Plug-inName/ServerName; Microsoft.Crm.Sandbox.WorkerProcess.exe (4504); 539A2153; execution time:00:01:04.9520100/-

Error-1:

Entity-1

30
Update
Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Microsoft.Crm.Extensibility.InternalOperationPlugin
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

Inner Exception: System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.

Error-2:

plugintype
30
RetrieveMultiple
Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Microsoft.Crm.Extensibility.InternalOperationPlugin
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

Inner Exception: System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.

Note: I have googled the issue and some blogs suggested to declare the "Server" object at Execute function level instead of Class level. I have verified, all the Plug-ins steps are registered at Execute function level only. 

Kindly let me know what is causing the error? 


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>