?
Solved

LINQ with NOLOCK/ROWLOCK/READPAST

Posted on 2010-01-12
1
Medium Priority
?
2,998 Views
Last Modified: 2013-11-11
hi, how do I set Locking when using LINQ to query a database (NOLOCK/READPAST) and to using LINQ to update a table (ROWLOCK) ?

is it possible to combine different types of locking in a single LINQ transaction scope ?
0
Comment
Question by:Michhoho
1 Comment
 
LVL 57

Accepted Solution

by:
Raja Jegan R earned 2000 total points
ID: 26300271
NOLOCK:

Just set the transaction isolation level to READ UNCOMMITTED to achieve NOLOCK equivalent and the example below:

http://www.infoq.com/news/2008/03/linq-nolock

ROWLOCK:

Haven't used this one on my own and hence test it out

http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/e9e958d0-0661-42a6-8793-d9d9108ec70b
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
SQL Database Recovery Software repairs the MDF & NDF Files, corrupted due to hardware related issues or software related errors. Provides preview of recovered database objects and allows saving in either MSSQL, CSV, HTML or XLS format. Ensures recov…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question