using (TransactionScope scope = new TransactionScope()) { //创建事物对象 try { //执行事务操作的相关代码 scope.Complete(); //提交事物 } catch (Exception ex) { throw ex; } //抛出异常 finally { scope.Dispose(); } //回滚事物 }
Asp.Net 自带的分布式事务(TransactionScope)的代码块
最新推荐文章于 2021-07-20 08:00:00 发布
