LINQ and Transaction Isolation Level

Posts   
 
    
Val
User
Posts: 37
Joined: 14-Nov-2008
# Posted on: 22-Jan-2009 19:41:52   

I have several LinqToLLBL expressions that I would like to run under a snapshot isolation level (SQL Server 2008 ) to avoid any kind of blocks. I noticed, by default, the isolation level is set to read committed and that should suffice most of the situations but I need to use snapshot for a handful of queries.

Thank you,

Val

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 22-Jan-2009 21:28:23   

You can set the isolation level by creating the transaction manually


adapter.StartTransaction(IsolationLevel.ReadCommitted, "ReadTransaction");

Val
User
Posts: 37
Joined: 14-Nov-2008
# Posted on: 22-Jan-2009 21:30:31   

I am using self-servicing though.

MTrinder wrote:

You can set the isolation level by creating the transaction manually


adapter.StartTransaction(IsolationLevel.ReadCommitted, "ReadTransaction");

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 22-Jan-2009 21:34:23   

Have a look at the documentation here

Val
User
Posts: 37
Joined: 14-Nov-2008
# Posted on: 22-Jan-2009 21:35:47   

Yup, that is what I need.

Thank you.