久久久久久久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 的原因)
主站蜘蛛池模板: 亚洲高清视频一区二区 | 成人国产综合 | 亚洲国产aⅴ精品一区二区 免费观看av | 91久久精品国产免费一区 | 亚洲一区二区三区乱码aⅴ 四虎在线视频 | 国产一区二区激情视频 | 亚洲福利| 在线观看av网站永久 | 欧美精品一区二区三区在线 | 国产一区二区三区免费 | 免费看国产一级特黄aaaa大片 | 日本成人在线观看网站 | 日韩精品一区二区三区中文字幕 | 亚洲欧美一区二区三区国产精品 | 色爱综合 | 国产精品不卡一区 | xxxxx免费视频 | 久久激情视频 | 亚洲视频免费观看 | 精品福利在线 | 国产精品欧美一区二区三区不卡 | 精品一区二区三区在线观看 | 伦理午夜电影免费观看 | 久久久久久久一区 | av中文字幕在线播放 | 国产精品一区免费 | 日日爱夜夜操 | 国产高清精品一区二区三区 | 国内久久 | 免费一级做a爰片久久毛片潮喷 | 欧美三级在线 | 亚洲精品久久久久中文字幕二区 | 天天草夜夜骑 | 妖精视频一区二区三区 | 久久免费精品 | 亚洲精品一区二区 | 特黄特黄a级毛片免费专区 av网站免费在线观看 | 日韩av网址在线观看 | 午夜一区二区三区视频 | 91资源在线 | 成人av色 |