EF + Multiple transaction, Multiple Context

1

I have been trying everything to make this situation working, but unable so far

  • Entity Framework
  • XUnit (testing library)
  • 2 DbContext (2 differents databases, 2 connections strings)

Situation: Run integration test with AutoRollBack feature (The AutoRollback feature manily wrap the code in a Parent transaction which is rolled back at the end of the test)

The Test looks like:

[AutoRollBack]
Test(){
Operation1 against DB1
Operation2 against Db2
}
  • I enabled MSDTC on both SQL Servers, used the DTCPing tool to confirm that the communication is ok between them

  • I Enabled Distributed Transaction in Inbound and Outbound Firewall in both servers

  • I Added distributed Transaction in Allowed Programs in Firewalls of both servers
  • Both servers can ping each other using Netbios name

But the 2nd operation in the Test will always return "the Underlying provider failed on Open" The MSDTC transaction manager was unable to pull the transaction from the source transaction manager due to communication problems. Possible causes are: a firewall is present and it doesn't have an exception for the MSDTC process, the two machines cannot find each other by their NetBIOS names, or the support for network transactions is not enabled for one of the two transaction managers. (Exception from HRESULT: 0x8004D02B)

I am looking for another way of debugging the problem. is there a way to have some logs of some sort for example

c#
sql-server
entity-framework
transactions
msdtc
asked on Stack Overflow Jul 2, 2015 by Hassan

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0