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

Fixup ends up with entries with different state managers in DbContext Pooling #11311

Closed
smitpatel opened this issue Mar 17, 2018 · 2 comments
Closed
Labels
area-test closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@smitpatel
Copy link
Member

https://github.com/aspnet/EntityFrameworkCore/blob/2bdb72f0206ef0f4657f565b5a5bf7226564befc/src/EFCore.Specification.Tests/GraphUpdatesFixtureBase.cs#L29

Enable pooling with above line.
Some tests fail.
I investigated in Optional_many_to_one_dependents_with_alternate_key_are_orphaned_starting_detached test for (ChangedNotifications : GraphUpdatesSqliteTestBase<ChangedNotifications.ChangedNotificationsFixture>)

Test remove dependent from one of the collection of the root. After save changes during fixup, while removing entity from root's collection when it fire CollectionChanged event, but the entity entry handling the event is incorrect entry and has StateManager from previous state. Since both of them have different NavigationFixer, we removing both sides of navigations (instead of just from parent to child).

Need to investigate more.

@ajcvickers
Copy link
Member

Note for implementer: I suspect this is because events are not be unscribed when the services are reset.

@divega divega modified the milestones: 2.1.0-preview2, 2.1.0 Apr 2, 2018
@ajcvickers
Copy link
Member

Investigated this and found that it is a test infra issue, so moving out of 2.1. The test fixture obtains the context from the pool, but then disposes of it in the normal way instead of returning it to the pool.

@AndriySvyryd AndriySvyryd added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jun 6, 2018
roji added a commit to roji/efcore.pg that referenced this issue Jul 22, 2018
* Switch to PoolableDbContext in various tests
  (dotnet/efcore#11311)
* Test for MinBatchSize
  (dotnet/efcore#10091)
roji added a commit to roji/efcore.pg that referenced this issue Aug 3, 2018
* Switch to PoolableDbContext in various tests
  (dotnet/efcore#11311)
* Test for MinBatchSize
  (dotnet/efcore#10091)
roji added a commit to roji/efcore.pg that referenced this issue Aug 10, 2018
* Switch to PoolableDbContext in various tests
  (dotnet/efcore#11311)
* Test for MinBatchSize
  (dotnet/efcore#10091)
roji added a commit to roji/efcore.pg that referenced this issue Aug 10, 2018
* Switch to PoolableDbContext in various tests
  (dotnet/efcore#11311)
* Test for MinBatchSize
  (dotnet/efcore#10091)
roji added a commit to roji/efcore.pg that referenced this issue Aug 12, 2018
* Switch to PoolableDbContext in various tests
  (dotnet/efcore#11311)
* Test for MinBatchSize
  (dotnet/efcore#10091)
roji added a commit to roji/efcore.pg that referenced this issue Aug 12, 2018
* Switch to PoolableDbContext in various tests
  (dotnet/efcore#11311)
* Test for MinBatchSize
  (dotnet/efcore#10091)
roji added a commit to roji/efcore.pg that referenced this issue Aug 12, 2018
* Switch to PoolableDbContext in various tests
  (dotnet/efcore#11311)
* Test for MinBatchSize
  (dotnet/efcore#10091)
@ajcvickers ajcvickers modified the milestones: 2.2.0-preview2, 2.2.0 Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-test closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

4 participants