How to implement a transaction at the business logic level

I am using the corporate library data access unit in my asp.net application. I want to implement a transaction from the level of business logic, through several stored procedures. Entlib opens a new connection to access the database. Does using transaction scope use the following distributed transaction?

using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required))
{
    // calling necessary DAL methods
   scope.Complete();
}  

Are there any better methods for implementing a transaction from BLL?

+3
source share
1 answer

If you are talking about SQL Server as a backend, it depends on the version of the server. Here is a good article: DO.NET and System.Transactions

I quote:

TransactionScope . , , Microsoft (DTC) . SQL Server 2005, DTC , SQL Server 2005 . SQL. SQL Server 2000 , DTC.

0

Source: https://habr.com/ru/post/1785840/


All Articles