交易内的书签 WF4.0

发布于 2024-11-10 10:36:44 字数 206 浏览 3 评论 0原文

我正在创建长期运行的工作流程,并将为持久性创建一个书签。 当我执行工作流程时,工作流程就像一个魅力。 当我将整个工作流程包含在事务范围内时,问题就在这里,一旦命中 .waitone(),它就不会完成执行,我看不到执行。

当然,我们需要将交易呈现在工作流程中。我检查了 DB 上的 DTC 设置为 ON。我认为问题在于 WF 4.0 中的书签和其上的事务。

I am creating long running workflow with will create a Bookmark for the persistance.
When I execute the workflow it is workflow is working like a charm.
Issue is here when I enclose the entire workflow in transaction scope, it is not completing its execution once it hits .waitone() I don't see the execution.

For sure we need the transaction to be present out the workflow. I checked the DTC setting on the DB its ON. I think issue is with bookmarking in WF 4.0 and transaction on top of it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

浪漫人生路 2024-11-17 10:36:44

您的工作流程执行需要多长时间。 TransactionScope 的默认超时时间为 1 分钟,如果执行时间更长,它将中止。持续 1 分钟的 ACID 事务通常会很长,它不应持续超过一秒或两秒,因为大多数事务都会对数据库等资源进行锁定。

另一件事是您无法在事务中间保留工作流程。事务是一个原子单元,在中间持续存在意味着您能够在中间重新启动,这将极大地破坏事务的原子性质。

How much time is you workflow taking to execute. A TransactionScope has a default timeout of 1 minute, if it takes any longer to execute it will abort. And an ACID transaction that lasts 1 minute is normally way to long, it should not last more than a second or 2 as most transactions place locks on resources like databases.

Another thing is you can't persist a workflow in the middle of a transaction. A transaction is an atomic unit and persisting in the middle would mean you are able to restart in the middle and that would very much break the atomic nature of the transaction.

迷你仙 2024-11-17 10:36:44

为什么在交易中需要书签?

Why would you need a bookmark within a transaction?

站稳脚跟 2024-11-17 10:36:44

Microsoft 确认 WF 4.0 支持长时间运行工作流在事务范围内。 (我没有记录此内容,但我们与 Microsoft 团队进行了通话,他们确认不支持它)。如果这样做会发生什么: 工作流暂停或挂起

整个 WF 4.0 存在事务范围问题(在工作流项目外部调用),这很奇怪。尽管我说 PersistableIdle.unload (应该持久保存到数据库并应该从内存中卸载),但这看起来像是一个简单的工作。我不明白为什么它的事务范围有问题。

Microsoft confirms that WF 4.0 does not support long running workflows inside transactionscope. (I don't have this documented but we had a call with Microsoft team, they confirmed that its not supported). What could happen if you do this: Workflow pauses or hangs

Its weird that Entire WF 4.0 has issues with transactionscopes(invoked outside workflow project). Even though I say PersistableIdle.unload (which should persist to the database and should unload from the memory) which look likes a simple job. I don't understand why its having issues with transactionscopes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文