这个是昨天上班的时候,写一个后台程序的调试程序时碰到的问题,和项目经理纠结了一天,最后搞定了.于是今天上班正好闲着,花了几乎一天的时间去网上找各种相关的资料.目前了解的内容如此: 根据使用的weblogic数据库驱动不同,可能会有两种报错: ① Cannot call commit/rollback when using distributed transactions. ② Cannot call Connection.commit/rollback in distribute…
首先是ef的多数据库操作实现事务的方法 public int AddDifferenceDB(userinfo1 user1, userinfo user) { ; using (var test2DB = new test2Entities1()) { using (var test1DB = new test1Entities1()) { using (TransactionScope trans = new TransactionScope()) { try { test2DB.Set<u…