简体   繁体   English

SharePoint列表项更新-使用REST API的并发

[英]SharePoint List Item Update - Concurrency Using REST API

I'm using REST API for updating the SharePoint list item (Counter). 我正在使用REST API更新SharePoint列表项(计数器)。 In my code on form load I'm fetching the count from list and increment to 1 & on submit button click I'm updating the value of count. 在表单加载代码中,我从列表中获取计数并递增到1,然后在提交按钮上单击以更新计数值。 Till here I have achieved. 到这里我已经实现了。

Problem arises , If two users submit the form at the same time, then counter value is incremented by 1 instead to 2 in the list. 出现问题,如果两个用户同时提交表单,则计数器值在列表中增加1而不是2。

Checked with etags . 与etags一起检查。 But I found that during post if etag doesn't match with get request etag then error will be thrown. 但是我发现,在发布期间,如果etag与get request etag不匹配,则会引发错误。

Is there way to achieve this functionality using REST API also incrementing the counter properly , if more than 3-4 users submit the form ? 如果有3-4个以上的用户提交表单,是否可以使用REST API来实现此功能,并且还可以适当地增加计数器?

SharePoint不会公开事务管理器,因此您可以在一个原子事务中将多个其余操作分组。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM