0

Let's say i update multiple items in a loop and then call executeQueryAsync() on ClientContext class and this call returns error (failed callback is invoked). Can i be sure that not a sinle item was updated of all these i wanted to update? is there a chance that some of them will get updated and some of them will not? In other words, is this operation transactional? Thank you, i cannot find a single post about it. I am asking about CSOM model not server solutions.

Martin
  • 404
  • 1
  • 5
  • 15

1 Answers1

1

SharePoint handles its internal updates in a transactional method, so updating a document will actually be multiple calls to the DB that if one method fails, will roll back the other changes so nothing is half updated on a failure.

However, that is not made available to us as an external developer. If you create an update that updates 9 items within your executeQueryAsync call and it fails on #7, then the first 6 will not be rolled back. You are going to have to write code to handle the failures and if rolling back is important, then you will have to manually roll back the changes within your code.

David Drever
  • 799
  • 2
  • 8
  • 21
  • Thank you very much for your answer. Can you also aprovide some official source supporting your claim? If there is any, because i did not find any, and i would really need this information to be confirmed – Martin Jan 04 '16 at 21:24
  • Nothing official. Just what I have seen myself and what veteran SP devs have commented on. https://social.msdn.microsoft.com/Forums/en-US/30004a3b-11bf-4fce-ba00-6946e8567be0/client-object-model-transactional-update-of-list-and-content-types?forum=sharepointdevelopmentprevious http://stackoverflow.com/questions/4658111/transactional-integrity-sharepoint-list – David Drever Jan 04 '16 at 21:32