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

Support System.Transactions in SqlClient for .NET Core #18918

Closed
divega opened this issue Oct 10, 2016 · 7 comments
Closed

Support System.Transactions in SqlClient for .NET Core #18918

divega opened this issue Oct 10, 2016 · 7 comments
Assignees
Labels
area-System.Data.SqlClient enhancement Product code improvement that does NOT require public API changes/additions
Milestone

Comments

@divega
Copy link
Contributor

divega commented Oct 10, 2016

Given System.Transactions is going to be included in 1.2 (see https://github.com/dotnet/corefx/issues/2949) the next step seems to be to bring auto-enlistment of ambient transactions and related behaviors into the .NET Core version of SqlClient.

Note that the corresponding EF Core feature (tracked at dotnet/efcore#5595) will depend on this to work with SQL Server.

@YoungGah YoungGah self-assigned this Oct 13, 2016
@saurabh500 saurabh500 assigned saurabh500 and unassigned YoungGah Mar 20, 2017
@saurabh500 saurabh500 removed their assignment May 16, 2017
@qizhanMS
Copy link
Member

Does SqlClient support some functionality such as EnlistTransaction for System.Transactions on .net core? There is a user reporting not able to use SqlConnection with System.Transactions on .net core. Please share current status and plan for supporting System.Transactions in SqlClient on .net core.

@saurabh500
Copy link
Contributor

The development of the feature is underway. Right now we don't support EnlistTransaction or any API related to System.Transactions in SqlClient.

sergiivolchkov referenced this issue in sergiivolchkov/Dapper Jul 4, 2017
According to https://github.com/dotnet/corefx/issues/12534, ambient transaction enlistment is not included with .net core 2.0.
@ghost
Copy link

ghost commented Jul 19, 2017

OK. I can live without Ambient Transactions, but are you saying that we can't even use explicit Transactions? How are you supposed to do anything remotely serious with SQL without Transactions?

@saurabh500
Copy link
Contributor

@DRAirey1 you can use DbTransaction APIs with SqlClient to manage transactions. System.Transactions cannot be used with SqlClient in 4.4.0

@geleems can we close this issue now that you have pushed your changes for ambient transactions and related APIs?

@ghost
Copy link

ghost commented Jul 19, 2017

How does this work with an n-Tier design? That is, how do I create a transaction that commits to my in-memory model and my persistent store (SQL Server) as an atomic action? I don't see how I do this with an SqlTransaction.

@geleems
Copy link

geleems commented Jul 19, 2017

Ambient Transaction and Transaction related APIs were ported from Framework: dotnet/corefx#22059

@geleems geleems closed this as completed Jul 19, 2017
@ghost
Copy link

ghost commented Jul 19, 2017

Yes. I see the Transactions. Yes. I see the SqlClient library. No, I can't get them to work together like they do in .NET Framework 4.7. I get 'Enlisting in Ambient transactions is not supported' when I try to execute EnlistTransaction().

I don't need Ambient Transactions, but I need some mechanism to make sure that my in-memory update and my SQL update are committed as a unit. If there's some new library or paradigm, I'm happy to look at it.

NickCraver referenced this issue in DapperLib/Dapper Aug 15, 2017
* Enable SqlDataRecord TVPs on netstandard1.3.
* Update netstandard2.0 SqlClient references to Preview 2.
* Skip TransactionScope tests for netcoreapp2.0.
- According to https://github.com/dotnet/corefx/issues/12534, ambient transaction enlistment is not included with .net core 2.0.
* Update references in Dapper.StrongName.
* Disable parallel test run to stabilize flaky type handler tests.
* Disable parallel test run by assembly attribute.
* Move Issue461 tests to TypeHandlerTests.
* Group type handler tests in a collection, re-enable parallelization.
- Being part of the same collection, type handler tests will run sequentially. All other tests can run in parallel.
* Move tests relying on query cache & type maps to a separate collection.
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.1.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Data.SqlClient enhancement Product code improvement that does NOT require public API changes/additions
Projects
None yet
Development

No branches or pull requests

6 participants