WITH (nolock) in every SELECT - NHibernate

I need to find a way to use with (nolock) on every SELECT I do in NHibernate. It doesn't matter if it is called with hql, Linq Queries or criteria, as long as the SELECT is executed, with (nolock) comes in!

+3


source to share


1 answer


Set your database transaction isolation level to SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

NOLOCK is equivalent to READUNCOMMITED, so you get the same effect if your connection is using a transaction isolation level.

ATTENTION! DANGER! READ IT!!!

This is the best explanation I have ever seen in NOLOCK HINT (and HINTS in general). It's worth reading:

SQL Server NOLOCK hint and other bad ideas



ADDITIONAL LINKS:

SET THE UNIT INSULATION LEVEL

Setting transaction isolation levels

Isolation levels (OLE DB)

+11


source







All Articles