Problem Statement: Asynchronous Plugins are failing intermittently because entity Records are being updated at very high pace
In Detail Analysis: We have a process where we frequently share/un-share Entity Records with Access Team. Asynchronous plugins executes after create and update. Dynamics CRM is integrated with multiple systems and receives updates in the system. We are facing an issue as these Async Plugins are failing with SQL Error,
Sql error: Generic SQL error. CRM ErrorCode: -2147204784 Sql ErrorCode: -2146232060 Sql Number: 1205
Plugin Logic,
1. Create Step - Shares the record with Access Team (Custom Logic decides, with which access team record should be shared)
2. Update step - Revokes the access of Access Team and Grant Access to new Access Team
In the Dynamics 365 web application, if user creates/updates a record, plugin executes and succeeded. Issue is if a record is being updated through integrated systems, at that point of time plugins fails. We tried below things as to resolve the issue,
- Changed the order of execution of Async Plugins
- Optimized the plugin code
These are not helping much, is there any way we can put delays between Plugin executions? Or any other way we can overcome this hurdle?
***Microsoft says update record frequency is too high(0.07 sec difference between 2 record update). Deadlock is being caused due to the execution of internal SP "p_CascadeRevokeAccess".