- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
System.Transactions事务详解[上篇]讲义
System.Transactions事务详解[上篇]
在.NET 1.x中,我们基本是通过ADO.NET实现对不同数据库访问的事务。.NET 2.0为了带来了全新的事务编程模式,由于所有事务组件或者类型均定义在System.Transactions程序集中的System.Transactions命名空间下,我们直接称基于此的事务为System.Transactions事务。System.Transactions事务编程模型使我们可以显式(通过System.Transactions.Transaction)或者隐式(基于System.Transactions.TransactionScope)的方式进行事务编程。我们先来看看,这种全新的事务如何表示。
一、System.Transactions.Transaction
在System.Transactions事务体系下,事务本身通过类型System.Transactions.Transaction类型表示,下面是Transaction的定义:
1: [Serializable]
2: public class Transaction : IDisposable, ISerializable
3: {
4: public event TransactionCompletedEventHandler TransactionCompleted;
5:
6: public Transaction Clone();
7: public DependentTransaction DependentClone(DependentCloneOption cloneOption);
8:
9: public Enlistment EnlistDurable(Guid resourceManagerIdentifier, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions);
10: public Enlistment EnlistDurable(Guid resourceManagerIdentifier, ISinglePhaseNotification singlePhaseNotification, EnlistmentOptions enlistmentOptions);
11: public bool EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification promotableSinglePhaseNotification);
12: public Enlistment EnlistVolatile(IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions);
13: public Enlistment EnlistVolatile(ISinglePhaseNotification singlePhaseNotification, EnlistmentOptions enlistmentOptions);
14:
15: public void Rollback();
16: public void Rollback(Exception e);
17:
18: void ISerializable.GetObjectData(SerializationInfo serializationInfo, StreamingContext context);
19:
20: public static Transaction Current { get; set; }
21:
22: public IsolationLevel IsolationLevel { get; }
23: public TransactionInformation TransactionInformation { get; }
24: }
1、Transaction是可序列化的
从上面的定义我们可以看到,Transaction类型(在没有特殊说明的情况下,以下的Transaction类型指的就是System.Transactions.
您可能关注的文档
最近下载
- 17J008 挡土墙(重力式、衡重式、悬臂式)(最新).pdf VIP
- 生成式人工智能应用基础:提示词工程PPT教学课件.pptx
- 2024-2025学年中职思想政治心理健康与职业生涯高教版(2023)教学设计合集.docx
- LSP污水处理工艺介绍.pdf VIP
- 产品生命周期管理操作手册.docx VIP
- 2024-2025学年小学信息技术(信息科技)四年级上册湘科版(2024)教学设计合集.docx
- 新《高等教育法规概论》考试复习题库600题(含各题型).pdf VIP
- 细胞培养基本知识-培训课件.ppt VIP
- 2025至2030中国固液分离设备行业项目调研及市场前景预测评估报告.docx
- 秋新教科版五年级上册科学全册教案(表格式)2021年.pdf
文档评论(0)