Using nhibernate, how can I set the transaction level to read uncommitted?
With SQL, I usually set the transaction level at teh beginning of my stored procedure or use inline (NOLOCK).
You can use nolock
in-line SQLs with nhibernate by using following steps:
Create HBM File with following
<sql-query name="PersonList">
return alias="person" class="Person">
SELECT * FROM Person WITH(nolock)
<sql-query>
Use AddXmlFile(hbm file path)
while creating nhibernate session.
Using DBSession.GetNamedQuery("PersonList")
get the list of persons.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With