回到目录

这个标题很有意思,关系表插入,就是说主表和外表键在插入时,可能会有同步插的情况,如在建立主表时,扩展表需要同步完成数据的初始化工作,而对于多表插入时,我们为了保证数据的一致性会针它写在事务中,而对于.net中的事件,它在一些情况下,会不那么单纯,对于ef和linq to sql来说,你的事务如果出现多次提交动作(submitchange | savechanges),那么,.net这边会把它提升为分布式事务(MSDTC),即.net认为,对于一个数据表的操作,不会出现多个savechanges,OK,这个可以解释的通,一个数据库,一个提交,这是符合性能要求的,呵呵,但对于我们的架构来说,有时一疏忽,就违背了.net的这个原则,如,我们封装的Insert方法,可能是这样的

   public virtual void Insert(TEntity item)
{
 
Db.Entry<TEntity>(item);
Db.Set<TEntity>().Add(item);
this.SaveChanges(); }

这个代码也没有问题,在一个插入动作完成后,系统由SaveChanges方法完成一次提交,正是由于这样的代码,所以我们的麻烦就来了,如果是对两个表的操作吗?

aRepository.Insert(a);
bRepository.Insert(b);

什么问题?数据一致性不能保证,因为没有事务块,呵呵,加上了再看看

  using (TransactionScope trans = new TransactionScope())
{
aRepository.Insert(a);
bRepository.Insert(b);
trans.Commit();
}

OK,感觉是没有问题了,但细一想就会看出问题来了,因为我们封装的insert会有提交动作,所以,在这个事务块中,.net会被认识是一个MSDTC(分布式的事务),原因是提交了多次,而如果你没有打开msdtc服务的话,就会出现下面的黄屏了

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAkwAAAD5CAIAAABanv17AAAgAElEQVR4nO19728V17nufPZn/wER8vmyr8yn84E50v1A5KsqV7eRottd6URRoiNaGjm6WtZBae69ibK5VQ4iJGloj9JDdbsgaZum3tHhknBaSiIqMrVFMdQtZTdAzMQYxwaDf2FjGwho7oc1s+Zdv2Zmbxtve3gePQLvmbXXrFk/3me971oz24sAAAAAoKTw2l0AAAAAAHhYgMgBAAAApQVEDgAAACgtIHIAAABAaQGRAwAAAEoLiBwAAABQWkDkAAAAgNLCInInAQAAAKAUgCcHAAAAlBYQOQAAAKC0gMgBAAAApQVEDgAAACgtI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Zoi9oFo/VQ+HATUuIHAiCIFhaQuRAEATB0nJ1IodtJiAIguAG5ipEjiqc5+ls942BIAiCYKsiBxkDQRAENzxbEjmpcKv7ZfCokrh9dCtzbUvqDuL1QmBzrEcVL8LjXCAIJmzXmlw9qnhR8lM75G/KvZEHgwW6WdsSVXaqByFyIAgqXIs1OXNBLndZrrEz8nrSj/Ue5WNMl/iB4NkogsiBIJjPVazJWWWs8C+DK6rW2Bl5WyLtjXmWg3sjzzPsGvjokca0Y4quIkRORsJJ/6ltiap7o3pPnD6dPJGwedwnbbMrRVDRD0Fw03AVa3KrETlhJmi4ktqjqmdYIvItGBdQ0OXJySh3lfQWoYviYzp/qkcVsvRb2xLrXNVYDxYaGX9EPwTBTcM1eoQg+6CVjZ3pHLxu8+Q0AwSCGnPDlfUeVeRk8CBZ7tXC5vK4lDSpdlVEzkFwU7J9IkdpX5NzHwfBqHmRMydMegdLvh5/cW9U6YkqPVjqA8HNy40hcmZ0SJAaKRDUuPYip3p4jZ1RrR5VxSKfGWkAQXATcAOIXNVzuGt7jWU5rIWAhPUeI8rdpMiJHiWPp2t4eyOvJ6r1RI2zUb0nqtq0EDEGENwMbJ/IVa1PfNOtbmaACCIHqqxad1cmZ/NF7myiWJ7atepRhQqe1uvU7S0gCG5grp3I4a2V4KND8SgCRA4ENzzxUzsg2CypnweC4IYmRA4Em6Hw4aBwILhJCJEDQRAES0uIHAiCIFhaQuRAEATB0nJVIudhLyUIgiC4gdm6yFGF8wy0/cZAEARBsEWRg4yB2WzUtnie53k99XaXBATBR5mtiJxUuNVJXb1WSfw+y6soxNktNbwwcDOzXrU2LgiC4DqxXWty9VrFqyS/J0f+jtmobfEqWyoQuc3Oeo9X2dloezFAEHxUuQZrcuaCXP6yXGNnhQay6j1qXGtv1dtSa4h/219HYOuEyIEg2Fb+fzWi/FzCOXz4AAAAAElFTkSuQmCC" alt="" />

注意:系统触发分布式事务的前提是你的WEB服务器与数据库服务器分别部署在两个服务器上,一台不会出现这个问题的。

OK,这个MSDTC是怎么一回事,不是今天要说的重要,如果想学习MSDTC,请看我的这些文章:

第二十六回   将不确定变为确定~transactionscope何时提升为分布式事务?

第二十七回   将不确定变为确定~transactionscope何时提升为分布式事务~续

第二十八回   将不确定变为确定~transactionscope何时提升为分布式事务~再续(避免引起不必要的MSDTC)

第二十九回   将不确定变为确定~transactionscope何时提升为分布式事务~大结局

今天我们要说的是在插入关系表时,怎样使它不被提升为分布式事务,事实上,怎么做我们已经知道了,就是方法中只出现一个savechages,呵呵,而对于主表与扩展表来说,对于自增主键的主表,做起来就有些麻烦了,呵呵,我们还需要借助SQL函数来实现主键的获取工作,当主键插入后,通过SQL函数得到新值,然后再为扩展表赋值,最后一些savechange()就可以了,具体我们看一下代码:

  int maxID = Convert.ToInt32(new TsingDa_NewLearningBarEntities()//当前表最大ID
.Database.SqlQuery<decimal>("SELECT IDENT_CURRENT ('Classroom_Info')")
.First());
using (TransactionScope trans = new TransactionScope())
{
try
{
db.Entry<Classroom_Info>(entity);
db.Set<Classroom_Info>().Add(entity); //绑定学生
entity.User_Classroom_R.ToList().ForEach(i =>
{
i.ClassroomInfoID = maxID + ;
db.Entry<User_Classroom_R>(i);
db.Set<User_Classroom_R>().Add(i);
});
db.SaveChanges();//是否为msdtc就看它提交的次数
trans.Complete();
}
catch (Exception)
{
trans.Dispose();//出现异常,事务手动释放
throw;
}
}

而一次savechanges所产生的SQL也是我们可以接受的,与服务器连接池中开启一个新连接,然后把语句一条一条的发过去,虽然不是一次性发送,但结果我们也是可以接受的,呵呵。

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlsAAADTCAIAAAA520G6AAAgAElEQVR4nO1dzZnjqhIlGm8IxWsCcQYkcR0EKfTmLmc5C24AvX1J6C0QUH9ISC23ZVTnq6+nR42gQKiOCmQfMxEE58L8a/TWGGN9mP+N6e9mRi6XipUCsBA4hBG9Lc3gU+BZpC3BH+ksxc8R//6Zpm81tWFMp7QOWk/XDI2FgBGnKbEQ4Jro3fy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bSnnNvFEn+EN8FjYaxZ52sFSu6u5cav1Zd1jYvmZzH1FYwpXYl5TpOdLHiDzdiiXope05EsHS//M+Yj5pEsqkIyFE/FcYTmvrPFDOlXspVEphsKSP4H0OWDdvK9WRQi/pCI4DY6Jn1RTg1z9wg/hY8W68/V3T/A7I0rsep7WPdr5l+gn9ip7wmB77PzygXY8Rz/8JfcU78HZGZAZSECHtUFNbMf2E/g4oI5bDRk1NTU1NtmtAGVGhmKYz5ohqaj+ygYP76zDwoCkjKjZAGVFtMBs4uL8OAw+aMqJiA5QR1QazgYP76zDwoLW69n9HovFF/hRdTwAAAABJRU5ErkJggg==" alt="" />

补充回复:

看了xiashengwang的 回复,我自己去试了一下,果然savechange将当前上下文中所有要提交的东西包在了一个事务块里,出现异常后,自动完成callback,所以,对 于一个数据库来说TransactionScope可以省去,而对于多个数据库的操作,才需要使用TransactionScope,而对于何时将 TransactionScope提升为MSDTC的级别,到目前为止,我只能说,一个上下文的savechanges不会提升,多个 savechanges就会提升到msdtc,而矛盾是,一个savechanges的话,确实不需要外加TransactionScope块了,呵呵, 这部分文章估计我还要继续写了,看看有没有办法在同一上下文多个savechanges操作时,不让系统提升到MSTDC的级别,呵呵。

回到目录

EF架构~关系表插入应该写在事务里,但不应该是分布式事务的更多相关文章

  1. EF架构~通过EF6的DbCommand拦截器来实现数据库读写分离~续~添加事务机制

    回到目录 上一讲中简单介绍了一个EF环境下通过DbCommand拦截器来实现SQLSERVER的读写分离,只是一个最简单的实现,而如果出现事务情况,还是会有一些问题的,因为在拦截器中我们手动开启了Co ...

  2. 第三代微服务架构:基于 Go 的博客微服务实战案例,支持分布式事务

    这是一个可一键部署在 Kubernetes-Istio 集群中的,基于 Golang 的博客微服务 Demo,支持分布式事务. 项目地址:https://github.com/jxlwqq/blog- ...

  3. 工资表的生成、显示、修改工资,应用transactionscope 分布式事务

    一: 二:SalarySheetDAL.cs using System; using System.Collections.Generic; using System.Linq; using Syst ...

  4. EF架构~通过EF6的DbCommand拦截器来实现数据库读写分离~终结~配置的优化和事务里读写的统一

    回到目录 本讲是通过DbCommand拦截器来实现读写分离的最后一讲,对之前几篇文章做了一个优化,无论是程序可读性还是实用性上都有一个提升,在配置信息这块,去除了字符串方式的拼接,取而代之的是sect ...

  5. Spring Cloud实战 | 第十篇 :Spring Cloud + Seata 1.4.1 + Nacos1.4.0 整合实现微服务架构中逃不掉的话题分布式事务

    Seata分布式事务在线体验地址:https://www.youlai.store 本篇完整源码地址:https://github.com/hxrui/youlai-mall 有想加入开源项目开发的童 ...

  6. 微服务架构下分布式事务解决方案——阿里GTS

    1 微服务的发展 微服务倡导将复杂的单体应用拆分为若干个功能简单.松耦合的服务,这样可以降低开发难度.增强扩展性.便于敏捷开发.当前被越来越多的开发者推崇,很多互联网行业巨头.开源社区等都开始了微服务 ...

  7. 微服务架构下分布式事务解决方案——阿里云GTS

    https://blog.csdn.net/jiangyu_gts/article/details/79470240 1 微服务的发展 微服务倡导将复杂的单体应用拆分为若干个功能简单.松耦合的服务,这 ...

  8. TCC分布式事务的实现原理(转载 石杉的架构笔记)

    拜托,面试请不要再问我TCC分布式事务的实现原理![石杉的架构笔记] 原创: 中华石杉 目录 一.写在前面 二.业务场景介绍 三.进一步思考 四.落地实现TCC分布式事务 (1)TCC实现阶段一:Tr ...

  9. EF架构~关于多对多关系表无法更新与插入的问题

    回到目录 在EF里,我们设计模型时,会设计到多对多关系,在EF里会把这种关系会转成两个一对多的关系表,这是比较友好的,因为多对多来说,对于业务本身没什么意思,所以隐藏了,没什么坏处,但对于这个隐藏来说 ...

随机推荐

  1. ORA-12543: TNS:destination host unreachable

    在连接Oracle数据库时,如果使用Tnsnames.ora中配置的数据源名称有时会报 ORA-12543: TNS:destination host unreachable 异常,比如:在Tnsna ...

  2. Pure.css网格系统学习心得——图片的响应式以及应用填充和边框网格单位的学习

    今天学习了pure.css可定制的网格系统,pure默认的网格系统是移动先行,如果我们想在小屏幕上有网格只要用pure-u-*就可以了,下面来说一下它的主要用法! <div class=&quo ...

  3. 电子数字 网易游戏在线笔试 第一题 hihocoder

    题目链接 http://hihocoder.com/contest/ntest2016spring1/problem/1 这个题目有几个算法考点: (1)对于一个LED数码管(由7个发光二极管封装在一 ...

  4. 使用joi来验证数据模型

    我们用nodejs实现一些功能时,往往需要对用户输入的数据进行验证.然而,验证是一件麻烦的事情,很有可能你需要验证数据类型,长度,特定规则等等,在前端做表单验证时,我们常用的做法是使用正则,正则表达式 ...

  5. :尝试加载 Oracle 客户端库时引发 BadImageFormatException。如果在安装 32 位 Oracle 客户端组件的情况下以 64 位模式运行,将出现此问题。 ---> System.BadImageFormatException: 试图加载格式不正确的程序。

    iis有程序池有一个属性  是否启用32位应用程序默认是true的特别注意windows2008 服务器系统iis默认的是true 这样发布一下也是必须要做的

  6. Hyper-V初涉_共享式网络链接

    任何一台计算机,如果不能与网络连通,可以说已经失去了大部分的功能,Windows 8尤是如此,虚拟机亦是如此. Hyper-V并不能对物理机的网卡进行识别,所以需要借助虚拟网卡通过物理机的网络共享实现 ...

  7. php 正则

    1.中括号 [0-9]匹配0-9 [a-z]匹配a-z小写字母 [A-Z]匹配A-Z大写字母 [a-zA-Z]匹配所有大小写字母 可以使用ascii来制定更多 2.量词 p+匹配至少一个含p的字符串 ...

  8. 【随记】Hello World小记

    今天装Python,如下: 突然想到,到现在,我已经数不清写过多少遍Hello World了. 最早是初一学VB的时候,用Label1在Form1上画一个,然后修改Caption属性为“Hello W ...

  9. Python成长笔记 - 基础篇 (十二)

    本节内容 ORM介绍 sqlalchemy安装 sqlalchemy基本使用 多外键关联 多对多关系 表结构设计作业 主题:学员管理系统 需求: 用户角色,讲师\学员, 用户登陆后根据角色不同,能做的 ...

  10. js 将long型字符串转换成日期格式

    工作中难免会碰到日期的转换,往往为了方便,后台都是把时间以long型(形如1343818800000)返回给web前端.再有前端自己根据页面需求转换成相应的日期格式.这里将我常用的一个转换时间的函数贴 ...