【发布时间】:2013-01-27 20:37:17
【问题描述】:
我试图了解如何确保仅在提交事务时才将日志条目输入到文件系统中。请看下面的代码。
Using (scope As TransactionScope = new TransactionScope())
'write log log file (line 2)'
scope.complete
End Using
在写入日志文件的那一刻,在事务范围完成之前。
我已阅读有关IEnlistmentNotification 接口的信息。我知道SQLConnection 类允许事务和分布式事务。因此我希望这个类实现IEnlistmentNotification,但它没有。为什么不呢?
【问题讨论】:
标签: .net sql vb.net ado.net transactions