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

Add a flag to opt into SaveChanges transactions even where they're not necessary #27574

Closed
roji opened this issue Mar 4, 2022 · 1 comment · Fixed by #28711
Closed

Add a flag to opt into SaveChanges transactions even where they're not necessary #27574

roji opened this issue Mar 4, 2022 · 1 comment · Fixed by #28711
Assignees
Labels
area-save-changes closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@roji
Copy link
Member

roji commented Mar 4, 2022

#27439 made us stop starting transactions where that isn't necessary (e.g. single-statement insertion). However, there may be cases where users still want a transaction to be created. For example, a user may be using a command interceptor to commit an additional row to the database (e.g. audit), and may want transactionality for the two rows.

Add a flag to allow users to get a transaction even when we don't require it.

@roji roji added this to the 7.0.0 milestone Mar 4, 2022
@roji roji self-assigned this Mar 4, 2022
roji added a commit to roji/efcore that referenced this issue Aug 14, 2022
Obsoletes AutoTransactionsEnabled, replacing it with a new 3-valued
enum.

Closes dotnet#27574
roji added a commit to roji/efcore that referenced this issue Aug 14, 2022
Obsoletes AutoTransactionsEnabled, replacing it with a new 3-valued
enum.

Closes dotnet#27574
@roji roji added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Aug 14, 2022
roji added a commit to roji/efcore that referenced this issue Aug 15, 2022
Obsoletes AutoTransactionsEnabled, replacing it with a new 3-valued
enum.

Closes dotnet#27574
roji added a commit to roji/efcore that referenced this issue Aug 15, 2022
Obsoletes AutoTransactionsEnabled, replacing it with a new 3-valued
enum.

Closes dotnet#27574
@ghost ghost closed this as completed in #28711 Aug 15, 2022
ghost pushed a commit that referenced this issue Aug 15, 2022
Obsoletes AutoTransactionsEnabled, replacing it with a new 3-valued
enum.

Closes #27574
@ajcvickers ajcvickers modified the milestones: 7.0.0, 7.0.0-rc1 Aug 16, 2022
@ajcvickers ajcvickers modified the milestones: 7.0.0-rc1, 7.0.0 Nov 5, 2022
@benlongo
Copy link

benlongo commented May 1, 2024

It might be worth mentioning that this exists near DbTransactionInterceptor. I had a hard time figuring out what guarantees I have around when DbTransactionInterceptor gets called, and a similarly difficult time finding out that this option exists.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-save-changes closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants