TransactionScope 处于中等信任状态
我正在运行由 Mosso 托管的 ASP.NET MVC 应用程序,有人告诉我他们无法启用 DTC,因为他们以中等信任度运行所有内容。
因此,当执行引用:TransactionScope 的代码时,我收到以下错误。事务管理器已禁用其对远程/网络事务的支持。 (HRESULT 异常:0x8004D024)
有什么办法可以解决这个问题吗?
Im running an ASP.NET MVC application hosted with Mosso, there are telling me that they cannot enable DTC because they run everything in medium trust.
So when executing code that references: TransactionScope I get the following error. The transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D024)
Is there anyway to get around this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否使用多个数据上下文?在 TransactionScope 中使用单个数据上下文不应强制将事务提升为分布式事务。如果您使用多个数据上下文,请确保它们共享同一连接。我认为,如果它们共享一个连接,它将获取与范围关联的事务并简单地使用它。如果没有,您可能需要在上下文上显式设置事务。
Are you using multiple data contexts? Using a single data context within a TransactionScope shouldn't force the transaction to be promoted to a distributed transaction. If you are using multiple data contexts, make sure that they are sharing the same connection. I would think that if they share a connection it would pick up the transaction associated with the scope and simply use it. If not, you might need to explicitly set the transaction on the context.