“持久性活动不能包含在非持久性块中”错误
我希望 WF4 中出现“持久活动不能包含在任何持久性块中”错误的规则。我看到你不能坚持第一次接收-发送之间,但我不明白一般的想法。
有什么意见吗?
谢谢
I would like the rule for which "Persist activities cannot be contained within no persistence blocks" error happens in WF4. I see that you can not persist between the first receive-send, but I do not understand the general idea.
Any comment?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
无持久区域的目标是表明您正在做一些无法从中恢复的事情。例如,Receive 和 SendReply 操作,如果您坚持在中间,如果工作流在稍后某个时刻中止,您也可以从那里恢复。如果您在 SendReply 之前恢复,恢复后的第一步是发送回复,但由于没有请求,因此没有地方可以发送回复。对于 TransactionScope 也是如此,你不能在事务中途重新启动。
因此,基本上,每当您在工作流上删除持久活动时,都会想到从磁盘重新加载工作流后能够从该点恢复工作流。
The goal of a no persist zone it to indicate that you are doing something that can't be resumed from the middle of it. For example a Receive and SendReply action, if you persist in the middle you can also resume from there if the workflow aborts at some later point. If you resume before the SendReply the first step after resuming is to send the reply but as there is no request there is no place to send the reply to. The same is try for a TransactionScope, you can't restart in the middle of the transaction.
So basically whenever you drop a persist activity on the workflow think of is as being able to resume the workflow from that point after reloading it from disk.