-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Description
Issue Title
Multiple Sqlconnections with Same connectionstring enlisting into distributed transaction.
General
When I open 2 SqlConnections as below and enlist each of them in the same committable transaction, it enlists as a distributed transaction. I would've thought if its the same connection string, we don't need to enlist as distributed transaction.
As a side note, distributed transactions are not supported in .NET Core as of 2.1. they seem to throw PlatformNotSupportedException(). Do you have plans of providing something similar to MSDTC in the future that works on linux boxes too? or is there other recommendations for alternatives to MSDTC to run with distributed transactions in .net core?
Code to reproduce:-
```
TransactionOptions options = new TransactionOptions();
options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
options.Timeout = TransactionManager.MaximumTimeout;
var tran = CommittableTransaction(options);
using (SqlConnection connection = GetSqlConnection("cn1"))
{
connection.Open();
connection.EnlistTransaction(tran);
}
using (SqlConnection connection = GetSqlConnection("cn1"))
{
connection.Open();
connection.EnlistTransaction(tran);
}
tran.Commit();