开发者

LinqDataSource set isolation level to READ UNCOMMITTED

开发者 https://www.devze.com 2023-03-06 21:00 出处:网络
Is it possible to somehow set LinqDataSource\'s IsolationLevel to READ UNCOMMITTED? I have LinqD开发者_如何学CataSource bound to pretty nasty SQL Server View (INNER JOIN to multiple tables) and somet

Is it possible to somehow set LinqDataSource's IsolationLevel to READ UNCOMMITTED?

I have LinqD开发者_如何学CataSource 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 the DataContext connection itself (would mean that if you use the same DataContext with other code that has different isolation level requirements, you would need to set up different ways of initializing the DataContext).

Other options include:

  • Open the DataContext in your codebehind, and set the transaction level thee
  • Access a stored procedure with your LinqDataSource or code, through your DataContext, and inside the stored procedure manually set the isolation level for the transaction.

See this blog post for more on there options.

0

精彩评论

暂无评论...
验证码 换一张
取 消