Is it possible to somehow set LinqDataSource’s IsolationLevel to READ UNCOMMITTED?
I have LinqDataSource bound to pretty nasty SQL Server View (INNER JOIN to multiple tables) and sometimes Deadlock exception is thrown if I load the page with all entries from view while site is under heavy load.
If you want to use
LinqDataSource, then try setting the isolation level as part of theDataContextconnection itself (would mean that if you use the sameDataContextwith other code that has different isolation level requirements, you would need to set up different ways of initializing theDataContext).Other options include:
DataContextin your codebehind, and set the transaction level theeLinqDataSourceor code, through yourDataContext, and inside the stored procedure manually set the isolation level for the transaction.See this blog post for more on there options.