比较 COM+ 和 ServiceModel 中的事务

本主题讨论如何使用命名空间提供的 Windows Communication Foundation (WCF) 属性 System.ServiceModel 模拟事务 COM+ 服务的行为。

使用 ServiceModel 属性模拟 COM+

下表比较了用于创建 TransactionOption 事务的 EnterpriseServices 枚举,以及它们如何与 System.ServiceModel 命名空间提供的 WCF 属性相关联。

COM+ 属性 WCF 属性
RequiresNew TransactionFlowAttribute 设置为 NotAllowed

TransactionScopeRequiredtrue

TransactionFlow绑定元素中的属性为 false.
必选 TransactionFlowAttribute 设置为 Allowed

TransactionScopeRequiredtrue

TransactionFlow绑定元素中的属性为 true.
已支持 没有直接等效项。 通常,您应采用为 Required 指定的行为。
不支持 TransactionScopeRequiredfalse

TransactionFlow绑定元素中的属性为 false.
禁用 没有直接等效项。 通常,您应采用为 NotSupported 指定的行为。