Our DBA insists that "with (nolock)" be added to all select queries. I know this is a stupid request by him, but I'm the lowly developer :P. In his defense, they do alot of batch stuff which does add some requirements like this. Anyhow, to satisfy this request, I tried the following :
Code:
public class CustomMsSql2000Dialect : MsSql2000Dialect {
public override string AppendLockHint(LockMode lockMode, string tableName) {
return tableName + " with (nolock)";
}
}
However, it appears that this isn't being called under all circumstances (joined tables, IQuery.UniqueResult, etc). It does appear to work when I call IQuery.List.
Setting the IsolationLevel to ReadUncommited does not appear to apply to all scenarios either and our DBA also doesn't believe in doing this at the .NET level anyhow. Does isolation level even apply in all of this totally anyhow?
So yes, dumb requirement or not, I have it, so any help would be appreciated.