Deadlock with entity framework & LINQ

江枫思渺然 提交于 2019-12-07 02:32:06

问题


I have a asp.net/mvc 3/entity framework 4.1 web application which access a class library to get look up table data. When I hit the website for the first time and try to load two different pages simultaneously the app pool hangs. No dead lock or any activity in the database. I used windbg/vs2010 debugger to look for thread locks. Two threads are locking at System.Component.TypeDescriptor.

The execution gets stuck at lookuptable.ToList Code :

   Using transaction As New TransactionScope(TransactionScopeOption.RequiresNew, 
            New TransactionOptions() With 
              {.IsolationLevel = IsolationLevel.ReadUncommitted})
            Using db As New Entity
              Dim lookuptable = From lk In db.LookUpTable Where lk.Id = pId Select lk
               returnValue = lookuptable.ToList
            End Using
    End Using

Parallel stack image:

Thanks for your help

来源:https://stackoverflow.com/questions/15816602/deadlock-with-entity-framework-linq

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!