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

Make proxies thread-safe accessing a navigation once loaded #32522

Merged
merged 1 commit into from
Dec 7, 2023

Conversation

ajcvickers
Copy link
Member

Fixes #32390

Since the DbContext is not thread-safe, lazy-loading proxies cannot be used from multiple threads when loading is happening. However, it is a common pattern to pass proxies to other parts of the application after the navigations have been loaded. At this time, accesses should be thread-safe. We broke this in 8.

Fixes #32390

Since the DbContext is not thread-safe, lazy-loading proxies cannot be used from multiple threads _when loading is happening_. However, it is a common pattern to pass proxies to other parts of the application after the navigations have been loaded. At this time, accesses should be thread-safe. We broke this in 8.
@ajcvickers
Copy link
Member Author

Will port to 8.0 for patch after merging.

@ajcvickers ajcvickers merged commit e72bde5 into main Dec 7, 2023
7 checks passed
@ajcvickers ajcvickers deleted the 231205_SmallHornBigHeart branch December 7, 2023 10:49
ajcvickers added a commit that referenced this pull request Dec 7, 2023
Fixes #32390

Since the DbContext is not thread-safe, lazy-loading proxies cannot be used from multiple threads _when loading is happening_. However, it is a common pattern to pass proxies to other parts of the application after the navigations have been loaded. At this time, accesses should be thread-safe. We broke this in 8.
wtgodbe pushed a commit that referenced this pull request Jan 3, 2024
…aded (#32547)

* Make proxies thread-safe accessing a navigation once loaded (#32522)

Fixes #32390

Since the DbContext is not thread-safe, lazy-loading proxies cannot be used from multiple threads _when loading is happening_. However, it is a common pattern to pass proxies to other parts of the application after the navigations have been loaded. At this time, accesses should be thread-safe. We broke this in 8.

* Qwerk
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.

Lazy loader throwing invalid operation exceptions
2 participants