Skip to content

Enable support for System.Transactions #5595

@divega

Description

@divega

(Forked from #4147 which was mainly about fixing the misleading exception message we throw to indicate that we don't support System.Transactions)

By design we don't support System.Transactions (a.k.a. ambient transactions / TransactionScope and or CommitableTransaction) functionality in EF Core 1.0.0.

In full .NET framework connection objects such as SqlConnection will still auto-enlist on Open() or OpenAsync() but we have code in EF Core to detect the presence of an ambient transaction an throw.

The new ConfigureWarnings() API allows turning the error into a warning or to ignore it completely, but since EF Core will always just start a local transaction in the connection anyway (i.e. with BeginTransaction()) the feature is actually not usable.

This issue is about the possibility of getting out of the way from System.Transactions by conditionally skipping the creation of the local database transaction in full .NET or in any other platform that supports it e.g. when/if https://github.com/dotnet/corefx/issues/2949 is implemented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions