高级系统事务调试
是否有任何提示、技巧或方法可以获取有关 System.Transactions.TransactionScope 运行时行为的分析/日志记录/调试信息?
我有一个正在将数据提交到数据库的应用程序,即使我使用的是 System.Transactions.TransactionScope,其中会引发异常并且 TransactionScope.Commit() 是从来没有打电话过。
我想知道 TransactionScope
使用的其他类是否有事件或详细信息,我可以在运行时查询这些事件或详细信息以确定我的命令(类型化数据适配器)是否正在征用环境事务。
使用 Reflector 查看了 System.Transactions.dll 后,我认为 System.Transactions.Diagnostics 命名空间可能会有所帮助,但任何示例将不胜感激。
Are there any tips, tricks or methods for obtaining profiling/logging/debug information on the runtime behaviour of System.Transactions.TransactionScope
?
I have an application which is committing data to the database, even though I'm using System.Transactions.TransactionScope
, where an exception is thrown and TransactionScope.Commit()
is never called.
I was wondering if there are events or details on other classes used by TransactionScope
that I can query at runtime to establish whether my commands (typed data adapters) are enlisting the ambient transaction or not.
Having looked at System.Transactions.dll
using Reflector, I think the System.Transactions.Diagnostics
namespace might help, but any examples would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看这篇文章:链接
添加将以下信息添加到您的应用程序配置文件中以跟踪 System.Transactions 调用
更多信息:
获得跟踪文件后,您可以在 SvcTraceViewer.exe 中打开跟踪
您还可以启用MSDTC事务跟踪、CM跟踪来了解有关事务的更多信息
参考:
Check-out this article: Link
Add following info to your application config file to trace System.Transactions calls
MORE INFO:
once you got trace file, you can open the trace in SvcTraceViewer.exe
You can enable MSDTC transaction trace,CM trace to know more about transaction also
Reference:
您是否正在创建带有参数的事务范围?
对于 Supress 的事务范围选项来说,这种行为是正常的。
否则你可以发布一些代码。
Are you creating a transaction scope with parameters?
This behaviour would be expected for transaction scope option of Supress.
Otherwise could you post some code.