Skip to content

Conversation

@miguelhasse
Copy link
Contributor

Pull Request

📖 Description

DataGrid with Paginator using IAsyncQueryExecutor for Entity Framework fails with the following error:
"A second operation was started on this context instance before a previous operation completed. This is usually caused by different threads concurrently using the same instance of DbContext."

🎫 Issues

fix: A second operation was started in DataGrid with EF Core #801

📑 Test Plan

Create a Blazor Server project that uses EF to connect a DataGrid component to a large database table, using IQueryable and pagination. Then quickly browse through pages to check there is no "second operation was started" exception. Ideally this should be done using integration tests using something like Testcontainers.

✅ Checklist

General

  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

Component-specific

  • I have added a new component
  • I have added Unit Tests for my new component
  • I have modified an existing component
  • I have validated the Unit Tests for an existing component

@miguelhasse
Copy link
Contributor Author

microsoft

@microsoft-github-policy-service agree

@bryansjenks
Copy link

I'll just note that we have this problem all over and if this fix addresses it; that would be really helpful.
Thanks everyone for your hard work on this project!
-Bryan

@miguelhasse miguelhasse requested a review from vnbaaij September 23, 2024 14:53
@vnbaaij vnbaaij changed the title Fix issue #801 - A second operation was started in DataGrid with EF Core [DataGrid] EF Core Adapter - A second operation was started Sep 23, 2024
@vnbaaij vnbaaij enabled auto-merge (squash) September 23, 2024 15:12
@vnbaaij vnbaaij merged commit 260842d into microsoft:dev Sep 23, 2024
@miguelhasse miguelhasse deleted the fix-issue-#801 branch September 23, 2024 15:19
@miguelhasse
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants