Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

1 solution

Why dont you want to give the developers access to the Connection object?

Sorry I dont think combining queries and executing them in a Transaction Block is the best approach. IMHO I think you should at least dev's access to some methods in the System.Transaction namespace.

See this article Introducing System.Transactions in the .NET Framework 2.0 and have a brainstorming session about giving your DAL some TransactionScope class lovin.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900