In my current project we have integrated order with our financial system and also we are using third party tool to generate order line items. After some time in production we started getting issue “Order is edited by multiple users” , and we were getting this issue only some times. After doing lot’s of testing what I found my order update plugin is called multiple times. After doing lot’s debugging what I found in my plugin context.depth is 1 but ever time correlationId was different. So I solved this issue by including below code in my plugin
if (_CorrelationID == Guid.Empty)
_CorrelationID = Context.CorrelationId;
else
{
if (_CorrelationID != Context.CorrelationId)
return;
}
try
{
// rest of the code
}
catch()
{//handle exception}
finally
{
_CorrelationID= Guid.Empty;}
This piece of code fixed my issue
Hi Mahendrapal,
I am same infinte loop error for plug-in update.Can you please let me know where to use this above code
Thanks,
Kirsh
Hi,
you need to write this code in the beginning of the Execure method.
Hi Mahenderpal,
Thanks for you fast response.But I am still getting the same issue and assume each time the correlationId is initialzed the value is empty and thus causing infiniteloop.
Thanks
Kirsh
did you try to check context.depth property ??