3

I've stubled upon a problem, and I'm unable to find an answer (or my google skills are really rubbish).

Our solution is an ASP MVC4 C# website and multiple class libraries. We use MS SQL2008 and EntityFramework 6.

Let's say I've got Foo and Bar object types. Foo contains a Bar object. Upon saving Foo I have to save Bar. Methods to save Foo and Bar are defined in different class libraries, each library has its own Entity model that contains tables from relevant schemas of the same base. Now the problem is I use transactions, and calling method that saves Bar leads to transaction level escalating "MSDTC disabled" exception.

Is there a way to avoid having to use MSDTC and still use different Entity Models that refer to the same base?

  • are the connection strings exactly equal? – JotaBe Jul 08 '14 at 12:19
  • Umm, is that even possible? The difference between the strings is the name and metadata. – Andrew Jaginoff Jul 08 '14 at 12:21
  • If you are connecting to different servers, the transaction must be a distributed transaction between those servers. And, I want to remember that the way to check if it's the same server had something to do with the connection strings. – JotaBe Jul 08 '14 at 12:25
  • Look this: [What server property makes TransactionScope escalating to MSDTC?][1] and this: [TransactionScope automatically escalating to MSDTC on some machines?][2] [1]: http://dba.stackexchange.com/questions/14318/what-server-property-makes-transactionscope-escalating-to-msdtc [2]: http://stackoverflow.com/questions/1690892/transactionscope-automatically-escalating-to-msdtc-on-some-machines – JotaBe Jul 08 '14 at 12:28
  • My App configs look like this: – Andrew Jaginoff Jul 08 '14 at 12:29

1 Answers1

0

Okay, so we found a solution. First of all, the strings must be exactly equal (excluding metadata). If that does not help, try making businesslogic classes that handle saving FOO and BAR into the database use the same instance of the TransactionHandler.