开发者

LinqDataSource set isolation level to READ UNCOMMITTED

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜