{"id":444,"date":"2011-03-24T06:34:47","date_gmt":"2011-03-24T06:34:47","guid":{"rendered":"http:\/\/mahenderpal.wordpress.com\/?p=444"},"modified":"2011-03-24T06:34:47","modified_gmt":"2011-03-24T06:34:47","slug":"order-is-edited-by-multiple-users-error","status":"publish","type":"post","link":"https:\/\/himbap.com\/blog\/?p=444","title":{"rendered":"Order is edited by multiple users Error"},"content":{"rendered":"<p>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 \u201cOrder is edited by multiple users\u201d , and we were getting this issue only some times. After doing lot\u2019s of testing what I found my order update plugin is called multiple times. After doing lot\u2019s 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<\/p>\n<p>  if (_CorrelationID == Guid.Empty)<br \/>\n                _CorrelationID = Context.CorrelationId;<br \/>\n            else<br \/>\n            {<br \/>\n                if (_CorrelationID != Context.CorrelationId)<br \/>\n                    return;<br \/>\n            }<br \/>\n            try<br \/>\n            {<br \/>\n                  \/\/ rest of the code<br \/>\n             }<br \/>\n             catch()<br \/>\n             {\/\/handle exception}<br \/>\n             finally<br \/>\n             {<br \/>\n              _CorrelationID= Guid.Empty;}<br \/>\nThis piece of code fixed my issue<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 \u201cOrder is edited by multiple users\u201d , and we were getting this issue only some times. After doing lot\u2019s of testing what I found my order&#8230; <a href=\"https:\/\/himbap.com\/blog\/?p=444\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10,20],"tags":[],"_links":{"self":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/444"}],"collection":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=444"}],"version-history":[{"count":0,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/444\/revisions"}],"wp:attachment":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}