实体框架不使用内存优化表 [英] Entity Framework not working with memory optimised tables
问题描述
我正在使用vb.net开发.net framework 4.5(最新)中开发的应用程序。数据库是SQL server 2016.我首先使用Entity Framework模型。 一切正常。几天前我决定将一些表更改为内存优化表。
在此更改之后,我使用数据库更新了Entity Framework。我有一个存储过程并将该存储过程导入整个框架,更新了内存优化表中的值。我调用此函数时遇到异常(映射到
SP)。这是异常文本
I am working on an application developed in .net framework 4.5 ( latest ) using vb.net. Database is SQL server 2016. I am using Entity Framework model first. All was working fine. Few days ago I decided to change some tables to memory optimised tables. After this change I updated Entity Framework with database. I have a stored procedure and imported that stored procedure into entire framework which updated the values in memory optimised table. I am getting exception when I call this function ( mapped to SP ) . Here is exception text
仅对自动提交事务支持使用READ COMMITTED隔离级别访问内存优化表。显式或隐式事务不支持它。使用表
提示为内存优化表提供支持的隔离级别,例如WITH(SNAPSHOT)。
Accessing memory optimized tables using the READ COMMITTED isolation level is supported only for autocommit transactions. It is not supported for explicit or implicit transactions. Provide a supported isolation level for the memory optimized table using a table hint, such as WITH (SNAPSHOT).
我用sql profiler捕获查询。当我在数据库中运行相同的查询时,这工作正常。所以问题似乎与实体框架和内存优化表兼容性。
I catch the query with sql profiler. when I run same query in database this works fine. So the issue seems with Entity Framework and memory optimised table compatibility.
任何人都可以帮助我。提前致谢
Can anybody help me. Thanks in advance
问候,
Irfan
推荐答案
查看以下是否有帮助
See if the following is of assistance
https://stackoverflow.com/questions/21508173/in-memory-user-defined-table-not-内存中
如果没有,我可以将您的问题转移到实体框架论坛。此外,EF团队确实监控StackOverFlow的EF问题,因此在Microsoft EF论坛中提出问题并使用EF在StackOverFlow中标记您的问题将为响应提供广泛的受众
。
If not I can move your question to the Entity Framework forum. Also, the EF team does monitor StackOverFlow for EF questions so having the questions in the Microsoft EF forum and tagging your question in StackOverFlow with EF would provide a broad audience for responses.
这篇关于实体框架不使用内存优化表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!