How to specify the level of database isolation to be used at a high level?

I use TransactionScopehigh level to wrap some high level code that makes several database connections.

One of the functions I call is a general read, which is used for read-only functions where an isolation level is required read uncommitted. But in some cases, it is used as part of a large update operation, but read committedwill be more appropriate.

At the highest level, where I call my functions inside the transaction scope, should I set the isolation level for the transaction?

+3
source share
2

TransactionScope. , ?

using (var txn = new TransactionScope(
    TransactionScopeOption.Required, 
    new TransactionOptions
    {
        IsolationLevel = IsolationLevel.ReadUncommitted
    }
))
{
    // Your LINQ to SQL query goes here
}

(, .)

+4

, /.

, , .

, SQL Server Read Committed, , , Read Commited / .

, , . , , Read Committed ?

? , .

,

.

, OLTP- , / SQL Server, . , . tempdb, , . SQL Server Row Versioning/Snapshot Isolation

http://msdn.microsoft.com/en-us/library/ms345124.aspx

+1

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


All Articles