问题描述
我正在为我的开发团队编写一个通用的DAL层,因为我们不想将连接的访问权限授予开发人员.我被困在提供处理面向事务的查询的选项方面.有人可以照亮吗?
因此,假设我有3个查询,这些查询必须在一个事务下执行.由于开发人员无权访问Connection,因此无法创建事务.
我是否应该从客户端获取一系列查询和参数,并在事务块内执行?这是正确的方法.
注意:-我没有使用ORM,因此也无法使用命令模式.
谢谢
Hi,
I''m writing a generic DAL layer for my development team because we dont want to give access of connection to the developers. I''m stuck in terms of providing option to handle Transaction oriented queries. Could some one throw light?
So, lets say I''ve 3 queries which have to be executed under one transaction. Since developer dont have access to Connection they can not create transactions.
Shall I take array of queries and parameters from client and execute within the Transaction Block? Is it a right approach.
Note:- I''m not using ORM hence I can not use Command Patterns also.
Thanks
推荐答案
这篇关于ADO.Net与交易的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!