久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

C# - System.Transactions.TransactionScope

C# - System.Transactions.TransactionScope(C# - System.Transactions.TransactionScope)
本文介紹了C# - System.Transactions.TransactionScope的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我對 TransactionScope 類很好奇.

I was curious about the TransactionScope class.

在大多數情況下,我認為它是用于數據庫連接(這就是我使用它的目的).

For the most part, I assume it was intended for database connections (which is what I've used it for).

我的問題是,您可以將任何代碼放在 TransactionScope 的 using 塊中以使其具有事務性嗎?MS 文檔對此并不清楚.

My question, is can you put any code in the using-block of a TransactionScope to make it transactional? MS documentation is not clear on this.

如果它可以用于使數據庫連接以外的代碼成為事務性的,那么支持哪些?如果它能讓 System.IO.File 操作成為事務性的,我覺得這很瘋狂.

If it can be used to make code other than database connections transactional, which ones are supported? It would seem crazy to me if it could make System.IO.File operations transactional.

推薦答案

TransactionScope 不僅適用于數據庫.每個實現 IEnlistmentNotification 接口的組件都可以參與事務范圍的兩階段提交.

TransactionScope is not only for the databases. Every component that implements IEnlistmentNotification interface can participate in two-phase commit of the transaction scope.

以下是事務性內存存儲的示例:http://www.codeproject.com/KB/dotnet/Transactional_Repository.aspx

Here is an example of transactional in-memory storage: http://www.codeproject.com/KB/dotnet/Transactional_Repository.aspx

此外,我不確定 .NET 中是否有用于事務文件 IO 的組件,但實現此類組件非常容易 - 最新的操作系統(如 Vista 和 Windows Server 2008)支持事務文件 IO.

Also, I'm not sure if there are components in .NET for transactional file IO, but it is pretty easy to implement such component - latest OS like Vista and Windows Server 2008 have support for transaction file IO.

這篇關于C# - System.Transactions.TransactionScope的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

LINQ to SQL and Concurrency Issues(LINQ to SQL 和并發問題)
SQL Server 2005 Transaction Level and Stored Procedures(SQL Server 2005 事務級和存儲過程)
Yield return from a try/catch block(try/catch 塊的收益回報)
Should I call Parameters.Clear when reusing a SqlCommand with a transation?(重用帶有事務的 SqlCommand 時,我應該調用 Parameters.Clear 嗎?)
Does SqlTransaction need to have Dispose called?(SqlTransaction 是否需要調用 Dispose?)
Reason for System.Transactions.TransactionInDoubtException(System.Transactions.TransactionInDoubtException 的原因)
主站蜘蛛池模板: 亚洲精品乱码久久久久久久久久 | 久久精品亚洲欧美日韩久久 | 国产在线中文字幕 | 日日天天 | 国产精品精品久久久 | 国产精品视频一二三 | 中文精品视频 | 国产在线观看一区二区 | 不用播放器看的av | 综合久久av | 黑人中文字幕一区二区三区 | 九七午夜剧场福利写真 | 欧美日韩一区二区三区在线观看 | 99re视频在线 | 中文字幕日本一区二区 | 精品真实国产乱文在线 | 亚洲一区日韩 | 亚洲a一区 | 97视频在线观看网站 | 国产精品成人一区二区三区 | 看特级黄色片 | 久久草在线视频 | 欧美一级片在线看 | 成人日批视频 | 日韩中文字幕一区 | 午夜专区 | 国产精品高潮呻吟久久av黑人 | 中文字幕一区在线观看视频 | 天天澡天天狠天天天做 | 日韩欧美不卡 | 国产一级视频 | 亚洲国产视频一区 | 午夜伦理影院 | 一级片免费视频 | 91精品久久| 91精品国产91久久久久久三级 | 成人福利视频 | 毛片一区二区三区 | 欧美一二三四成人免费视频 | 91精品国产综合久久婷婷香蕉 | 欧美国产日韩成人 |