Is there any way in which I can modify all, or a specific Breeze query, to query with NoLock on?
So far I have tried two approaches.
The first approach consisted of deriving from BreezeConfig - similar to https://github.com/IdeaBlade/Breeze/blob/master/_Internal/Sample_WebApi/Controllers/BreezeConfig.cs
then overriding GetTransactionSettings as follows, hoping that all queries will now be wrapped by transactions.
public override TransactionSettings GetTransactionSettings()
{
var settings = base.GetTransactionSettings();
settings.TransactionType = TransactionType.TransactionScope;
settings.IsolationLevel = System.Transactions.IsolationLevel.ReadUncommitted;
return settings;
}
Sql profiler shows me that my reads aren't wrapped in transactions :/
The second approach I tried is to modify EFContextProvider's behaviour. This failed - the only hooks I can find, even if I derive, are for modifying save-changes. Nothing for read-only behaviour.
Im still investigating Jay's suggestion. But I probably have no idea what i'm doing.