5

I'm using Entity Framework 6.1.0 with SQL Server 2014.

I'm attempting to perform several operations under a transaction which i've created like this:

(var transaction = context.Database.BeginTransaction())
{


}

But I'm getting an error

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).

I have tried all possible isolation levels (those allowed for in memory tables) but to no avail.

How can I perform atomic transactions from code with in memory tables?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

2

The solution was to enable MEMORY_OPTIMIZED_ELEVATE_TO_SNAPSHOT

Resource: http://msdn.microsoft.com/en-us/library/dn133175(v=sql.120).aspx

  • More info: http://stackoverflow.com/questions/21508173/in-memory-user-defined-table-not-in-memory – VahidN Jun 07 '14 at 09:40