Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Multiple Sqlconnections with Same connectionstring enlisting into distributed transaction #13

Copy link
Copy link

Description

@Petermarcu
Issue body actions

@leo12chandu commented on Fri Aug 24 2018

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();
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.