0

I have a function which updates list items. I use fiddler 2 for tracking the traffic. When I stress test the function I get code=-2130575305, Microsoft.SharePoint.SPException error, and the error message text is

"Save Conflict. Your changes conflict with those made concurrently by another user. If you want your changes to be applied, click Back in your Web browser, refresh the page, and resubmit your changes."

I am using the cross-domain library and my query is

var url = appUrl + "/_api/SP.AppContextSite(@target)/Web/Lists/getByTitle('" + listName + "')/Items(" + itemId + ")/validateupdatelistitem?&@target='" + hostUrl + "'";

and the executor code is

executor.executeAsync({ url: url, method: "POST", body: mappingFunction(dataObject), headers: { "accept": "application/json; odata=verbose", "content-type": "application/json;odata=verbose" },

Is there a way to force SP to delay the attempt to update the item so that it doesn't throw a concurrency error? Or, what is the right approach to this problem?

Edit: I mentioned some additional information in my comment below. If anyone has any ideas they are going to be highly appreciated. Concurrency conflicts are probably managed easier on the server side, but I am looking to find out if anything can be done from the client side.

0

To me this should not be a real issue:

If you think of your method calls as multiple users playing with the same list item in the GUI, they should not be able to save if the underlying data has changed since they started their update.

Your script function is mimicking the same behavior but with code. The situation should not happen very often I real life (not stress testing) if you do not have another, more architectural, problem in your solution.

  • Hi, thanks for the reply. It looks like you suggested disregarding the problem. I don't think I can do that. I am migrating an Excel application to Sharepoint and one of the requirements is that I use the same database structure, which is not exactly normalized. It contains fields that otherwise should have been reduced to separate tables, and two users can compete for the right to modify the same row just because of the structure of that table. So, I still need an answer, please. Also is there a way to reset errors thrown by executeAsync so that the app keeps running without fussing? – user27227 Aug 3 '14 at 1:34
  • I'm sorry but, regardless of witch API /methods you use in SharePoint, if the list item data has changed since you opened it and you are trying to make an update on it SharePoint will give you this error. – Robert Lindgren Aug 3 '14 at 6:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.