EF6 with "inability to start a distributed transaction"

I have several websites running on a server. These nodes access the local database, and the database calls a stored procedure on the linked server.

All websites are working fine except those now running Entity Framework 6.1.1.

When the call is complete, we get an error: The operation could not be performed because OLE DB provider "SQLNCLI10" for linked server "___" was unable to begin a distributed transaction.

Code running at this point is autogenerated using the .tt file ...

return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("procname", param1, param2, param3, param4);

      

As mentioned, this works with older versions of EF. (This is not a MSDTC configuration issue.)

On this page ( Working with Transactions (EF6 Onwards) ):

Starting with EF6 Database.ExecuteSqlCommand (), by default, a command in a transaction will be completed if it was not already present. There are overloads of this method that allow you to override this behavior if you like. Also in EF6, executing stored procedures that are included in the model through an API, such as ObjectContext.ExecuteFunction () , does the same (except that the default behavior cannot be overridden at this time ).

I am stuck? Do I need to go back to Entity Framework 5?

+3
entity-framework-6.1 sql-server-2008-r2


source to share


No one has answered this question yet

See similar questions:

1
Stored procedure that works when calling exec sp and throws from EF6 to SQL Azure

or similar:

five
How can I save the results of a stored procedure without requiring a distributed transaction?
3
TransactionScope is promoted to MSDTC although I am using the same connection string
2
How do I fix Fatal Error 605 on SQL Server 2008 R2?
1
Understanding and Investigating CommitFailedException in MySQL
1
using sqlcmd script my linked server queries are not connecting
1
Firebird EF6 DDEX VS2013 Community Update 4 Dynamic SQL Error
0
EF6 - ERROR? - Migration checks the design DB, but writes to build the DB
0
Executing a parallel query while synchronizing in SQL Server
-1
SQL Server 2008 R2 default blocking settings
-1
how to get the value of the use id column before transaction?



All Articles
Loading...
X
Show
Funny
Dev
Pics