Skip to content

[release/7.0] Reset query tracking behavior correctly if set on DbContextOptions - #29797

Merged
wtgodbe merged 2 commits into
release/7.0from
ComeBackStrider1208
Jan 4, 2023
Merged

[release/7.0] Reset query tracking behavior correctly if set on DbContextOptions#29797
wtgodbe merged 2 commits into
release/7.0from
ComeBackStrider1208

Conversation

@ajcvickers

@ajcvickers ajcvickers commented Dec 8, 2022

Copy link
Copy Markdown
Contributor

Port of #29766
Fixes #29733

Description

When using DbContext pooling, a query tracking behavior of NoTracking could be changed to TrackAll after the context has been returned to the pool and retrieved again.

Customer impact

Queries running with the wrong tracking behavior could result in application crashes, incorrect data, and reduced performance.

How found

Customer reported on 7.0

Regression

Yes, from 6.0.

Testing

Added a tests around this area where the tracking behavior is specified on the options builder.

Risk

Low; simple code change, and a quirk was added to revert back to older behavior.

@ajcvickers
ajcvickers requested a review from a team December 8, 2022 12:03
@ajcvickers ajcvickers added this to the 7.0.x milestone Dec 8, 2022
@rbhanda rbhanda modified the milestones: 7.0.x, 7.0.3 Dec 8, 2022
@wtgodbe
wtgodbe merged commit c70e72a into release/7.0 Jan 4, 2023
@wtgodbe
wtgodbe deleted the ComeBackStrider1208 branch January 4, 2023 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants