SharePoint - 运行并发自定义计时器作业
我有一个应用程序,用户可以安排仅运行一次的自定义计时器作业。问题是多个计时器作业可能会同时进行。在这种情况下,如果他们尝试更新同一对象(例如 SPWeb),那么我将面临一个问题,该问题会出现以下错误。
正在更新的网页已更改为 外部进程。
当我在 Google 中进行一些基本搜索时,我发现 此线程讨论此异常。据我所知,当 SPWeb 处于陈旧状态时会发生这种情况。但定时器作业不知道这一点。
那么有没有一种锁定机制或其他解决方法可以解决这个问题呢?
I've an application where user can schedule custom timer jobs which runs only one time. The problem is that the several timer jobs may exactly at the same time. In that case, if they try to update a same object (for eg. SPWeb) then I'm facing a problem which gives the following error.
The web being updated was changed by
an external process.
When I did some basic search in Google I found this thread which talks about this exception. I understand that this happens when the SPWeb is in a stale state. But timer jobs do not know this.
So is there a way of locking mechanism or some other work around for this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我已经解决了这个问题。这是简短而甜蜜的答案 -
当我从共享对象创建新的 SPWeb 对象时,效果很好。
Okay, I've solved the issue. Here is the short and sweet answer -
Worked well for me when I created a new SPWeb object from the shared object.