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

[5.0.2] Fix event counter issues #23616

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/EFCore/ChangeTracking/Internal/StateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,8 @@ protected virtual async Task<int> SaveChangesAsync(
{
using (_concurrencyDetector.EnterCriticalSection())
{
EntityFrameworkEventSource.Log.SavingChanges();

return await _database.SaveChangesAsync(entriesToSave, cancellationToken)
.ConfigureAwait(false);
}
Expand Down
6 changes: 4 additions & 2 deletions src/EFCore/DbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ public DbContext([NotNull] DbContextOptions options)
ServiceProviderCache.Instance.GetOrAdd(options, providerRequired: false)
.GetRequiredService<IDbSetInitializer>()
.InitializeSets(this);

EntityFrameworkEventSource.Log.DbContextInitializing();
}

/// <summary>
Expand Down Expand Up @@ -347,8 +349,6 @@ private IServiceProvider InternalServiceProvider
{
_initializing = true;

EntityFrameworkEventSource.Log.DbContextInitializing();

var optionsBuilder = new DbContextOptionsBuilder(_options);

OnConfiguring(optionsBuilder);
Expand Down Expand Up @@ -642,6 +642,8 @@ public virtual async Task<int> SaveChangesAsync(
}
catch (DbUpdateConcurrencyException exception)
{
EntityFrameworkEventSource.Log.OptimisticConcurrencyFailure();

await DbContextDependencies.UpdateLogger.OptimisticConcurrencyExceptionAsync(this, exception, cancellationToken)
.ConfigureAwait(false);

Expand Down
3 changes: 3 additions & 0 deletions src/EFCore/Storage/ExecutionStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ private async Task<TResult> ExecuteImplementationAsync<TState, TResult>(
catch (Exception ex)
{
Suspended = false;

EntityFrameworkEventSource.Log.ExecutionStrategyOperationFailure();

if (verifySucceeded != null
&& CallOnWrappedException(ex, ShouldVerifySuccessOn))
{
Expand Down