Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable support for System.Transactions #5595

Closed
divega opened this issue May 31, 2016 · 5 comments
Closed

Enable support for System.Transactions #5595

divega opened this issue May 31, 2016 · 5 comments
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. punted-for-2.0 type-enhancement
Milestone

Comments

@divega
Copy link
Contributor

divega commented May 31, 2016

(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.

@divega
Copy link
Contributor Author

divega commented Oct 10, 2016

Progress has been made for the feature to be available in .NET Core 1.2, although SqlClient for .NET Core still doesn't do anything with ambient transactions (plus auto-enlistment never stopped working in .NET Framework).

Clearing up milestone and ownership so that we can decide what to do and who to assign it to in triage.

@roji
Copy link
Member

roji commented Jul 4, 2017

Please note that Npgsql already supports .NET Standard 2.0, and so has System.Transaction support as well. In other words, adding System.Transaction support to EF Core doesn't necessarily depend on SqlClient adding support.

@patricknolan
Copy link

Hi...is the use of TransactionScope with EntityFramework Core now supported?

@divega divega added this to the 2.1.0 milestone Jul 27, 2017
@divega divega removed this from the Backlog milestone Jul 27, 2017
@divega divega added the pri0 label Jul 27, 2017
@divega divega changed the title Consider enabling support for ambient transactions in platforms that have it Enabling support for ambient transactions in platforms that have it Aug 7, 2017
@divega divega changed the title Enabling support for ambient transactions in platforms that have it Enabling support for System.Transactions' ambient transactions in platforms that have it Aug 7, 2017
@divega divega changed the title Enabling support for System.Transactions' ambient transactions in platforms that have it Enable support for System.Transactions Aug 7, 2017
@bricelam
Copy link
Contributor

Will we need aspnet/Microsoft.Data.Sqlite#294 for this?

@AndriySvyryd
Copy link
Member

We don't need it, since this is mostly about the work in Relational. It will probably still throw for providers that don't explicitly support it.

AndriySvyryd added a commit that referenced this issue Aug 24, 2017
AndriySvyryd added a commit that referenced this issue Aug 25, 2017
AndriySvyryd added a commit that referenced this issue Aug 25, 2017
AndriySvyryd added a commit that referenced this issue Aug 25, 2017
AndriySvyryd added a commit that referenced this issue Aug 28, 2017
AndriySvyryd added a commit that referenced this issue Aug 29, 2017
AndriySvyryd added a commit that referenced this issue Aug 29, 2017
AndriySvyryd added a commit that referenced this issue Aug 31, 2017
AndriySvyryd added a commit that referenced this issue Aug 31, 2017
AndriySvyryd added a commit that referenced this issue Aug 31, 2017
AndriySvyryd added a commit that referenced this issue Sep 2, 2017
AndriySvyryd added a commit that referenced this issue Sep 7, 2017
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Oct 6, 2017
@AndriySvyryd AndriySvyryd removed their assignment Feb 27, 2018
@ajcvickers ajcvickers modified the milestones: 2.1.0-preview1, 2.1.0 Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. punted-for-2.0 type-enhancement
Projects
None yet
Development

No branches or pull requests

7 participants