您将在哪一层使用 asp.NET TransactionScope 实现事务? [英] In which layer would you implement transactions using asp.NET TransactionScope?

查看:25
本文介绍了您将在哪一层使用 asp.NET TransactionScope 实现事务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个服务、业务和数据访问层.我应该在哪一层使用 asp.NET 事务范围来实现事务?另外,嵌套事务是否是一件好事,因为我遇到了问题?

I have a service, business and data access layer. In which layer should I implement transactions using asp.NET transactionscope? Also, is nesting Transactions a good thing because I had problems with that?

推荐答案

事务范围是 .net 的一部分,并非特定于 asp.net

Transaction Scope is part of .net not specific to asp.net

我们会将交易范围放在业务层中.服务层更像是一个外观.如果某事需要交易,则应在单个业务运营中进行.

We would place the tansaction scope in the business layer. The service layer is more of a facade. If something requires a transaction it should be within a single business operation.

这篇关于您将在哪一层使用 asp.NET TransactionScope 实现事务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆