实体框架 4 +火鸟->如果有其他事务打开,则在 Fetch 时冻结
问题如下:
如果我正在 IBExpert 中编辑一行并且不提交事务,则 EF 在尝试获取数据( Entity.ToList() )时就会冻结。如果在尝试更新行时发生这种情况,我会理解,但为什么 EF 无法获取该行的提交版本?
挂起时,如果我在 IBExpert 中提交事务,它会立即继续提取,一切都会正常。
重现步骤: 1->在 IBExpert 或其他软件中编辑行。 2->尝试在 EF 中获取该行。它将冻结,直到您提交其他事务。
这让我发疯,我在任何地方都找不到解决方案!
The problem is as folows:
If i am editing a row in IBExpert and dont commit the transaction, the EF just freeze when trying to fetch Data ( Entity.ToList() ). I Would understand if that happened when trying to update the row, but why does the EF cant fetch the commited version of the row?
When hanging, if i commit the transaction in IBExpert, it immediately continue the fetch and everything gets ok.
Steps to reproduce:
1 -> Edit a row in IBExpert or other software.
2 -> Try to FETCH that row in the EF. Its going to freeze until you commit the other transaction .
Its driving me crazy, i cant find solutions anywhere!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能与事务隔离级别有关。如果启用了 WAIT 选项,则在使用 READ_COMMITTED 隔离级别(默认)时,它将等待直到提交未提交的事务。
更多信息:http://fhasovic.blogspot.com/2005/ 02/transaction-isolation-levels-in.html
It's probably all about transaction isolation levels. If you have WAIT option enabled, it will wait until uncommitted transactions are committed when using READ_COMMITTED isolation level (default).
More information: http://fhasovic.blogspot.com/2005/02/transaction-isolation-levels-in.html