在EF4中使用NOLOCK提示? [英] Using NOLOCK Hint in EF4?

查看:132
本文介绍了在EF4中使用NOLOCK提示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在评估EF4,而我的DBA说我们必须在所有的SELECT语句中使用NOLOCK提示。所以我正在研究如何使用EF4来实现这一点。



我已经阅读了关于如何在EF4中实现这一点的不同想法,但是似乎都像一个工作,没有被微软或EF4认可。在使用LINQ-to-SQL / LINQ-to-Entities和EF4时,希望他们的SELECT语句包含NOLOCK提示的官方微软响应是什么?



顺便提一下,我发现绝对最好的信息是在这里,我鼓励对此主题感兴趣的人阅读此主题。



谢谢。

解决方案

NOLOCK =READ UNCOMMITTED= dirty reading



他们选择默认隔离级别为READ COMMITTED



NOLOCK,实际上任何提示应该非常明智地使用:不是默认使用。



你的DBA是一个muppet。参见(SO):在SQL Sever中的每个SELECT上使用(nolock)可能会发生什么?如果你碰巧在银行工作,或者我可能有一个帐户的机构工作,请让我知道,以便关闭它。


We're evaluating EF4 and my DBA says we must use the NOLOCK hint in all our SELECT statements. So I'm looking into how to make this happen when using EF4.

I've read the different ideas on how to make this happen in EF4, but all seem like a work around and not sanctioned by Microsoft or EF4. What is the "official Microsoft" response to someone who wants their SELECT statement(s) to include the NOLOCK hint when using LINQ-to-SQL / LINQ-to-Entities and EF4?

By the way, the absolute best information I have found was right here and I encourage everyone interested in this topic to read this thread.

Thanks.

解决方案

NOLOCK = "READ UNCOMMITTED" = dirty reads

I'd assume MS knows why they chose the default isolation level as "READ COMMITTED"

NOLOCK, in fact any hint, should be used very judiciously: not by default.

Your DBA is a muppet. See this (SO): What can happen as a result of using (nolock) on every SELECT in SQL Sever?. If you happen to work at a bank, or any institution where I may have an account please let me know so I can close it.

这篇关于在EF4中使用NOLOCK提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆