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 opting out of wrapping database operations in a transaction during SaveChanges() #6339

Closed
divega opened this issue Aug 16, 2016 · 0 comments
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@divega
Copy link
Contributor

divega commented Aug 16, 2016

Wrapping all database operations in a transaction during SaveChanges() is important to keep data in the database consistent and we should always do it by default. However for certain applications trading off data consistency for a performance gain may be acceptable. Some testing performed in https://github.com/aspnet/benchmarks has shown that the performance gain can be significant.

@divega divega added this to the 1.1.0 milestone Aug 17, 2016
ajcvickers added a commit that referenced this issue Aug 25, 2016
…uring SaveChanges()

Issue #6339

```C#
context.Database.AutoTransactionsEnabled = false;
```

Doesn't affect anything done with UseTransaction or BeginTransaction--only prevents EF from creating a transaction automatically.

Also some perf improvements for running the transaction tests--previously when running on my machine they would take about 70 seconds. Now they take about 3. But note that most of this is masked when running many tests in parallel.
ajcvickers added a commit that referenced this issue Aug 25, 2016
…uring SaveChanges()

Issue #6339

```C#
context.Database.AutoTransactionsEnabled = false;
```

Doesn't affect anything done with UseTransaction or BeginTransaction--only prevents EF from creating a transaction automatically.

Also some perf improvements for running the transaction tests--previously when running on my machine they would take about 70 seconds. Now they take about 3. But note that most of this is masked when running many tests in parallel.
ajcvickers added a commit that referenced this issue Sep 2, 2016
…uring SaveChanges()

Issue #6339

```C#
context.Database.AutoTransactionsEnabled = false;
```

Doesn't affect anything done with UseTransaction or BeginTransaction--only prevents EF from creating a transaction automatically.

Also some perf improvements for running the transaction tests--previously when running on my machine they would take about 70 seconds. Now they take about 3. But note that most of this is masked when running many tests in parallel.
@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 Sep 2, 2016
@ajcvickers ajcvickers modified the milestones: 1.1.0-preview1, 1.1.0 Oct 15, 2022
@ajcvickers ajcvickers removed their assignment Sep 1, 2024
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. type-enhancement
Projects
None yet
Development

No branches or pull requests

2 participants