You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calls to GetAllSubjectResources can cause dbcontext concurrency error
Reproduction
For local reproduction, set FusionCache duration on the SubjectResource cache to 1 second here
Call /api/v1/serviceowner/dialogs/ with a enduserId and a ServiceResource
Expected behavior
Returns dialog(s) belonging to the indicated ServiceResource and visible to the given EnduserId
Actual behavior
500: Internal Server Error
System.InvalidOperationException
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. For more information on how to avoid threading issues with DbContext, see https://go.microsoft.com/fwlink/?linkid=2097913.
Additional information
The text was updated successfully, but these errors were encountered:
…1648)
Add dedicated scope and dbcontext to GetSubjectResources to avoid
concurrency errors
<!--- Provide a general summary of your changes in the Title above -->
## Description
<!--- Describe your changes in detail -->
## Related Issue(s)
- #1649
## Verification
- [x] **Your** code builds clean without any errors or warnings
- [x] Manual testing done (required)
- [ ] Relevant automated test added (if you find this hard, leave it and
we'll help out)
## Documentation
- [ ] Documentation is updated (either in `docs`-directory, Altinnpedia
or a separate linked PR in
[altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if
applicable)
Description
Calls to GetAllSubjectResources can cause dbcontext concurrency error
Reproduction
Expected behavior
Returns dialog(s) belonging to the indicated ServiceResource and visible to the given EnduserId
Actual behavior
500: Internal Server Error
System.InvalidOperationException
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. For more information on how to avoid threading issues with DbContext, see https://go.microsoft.com/fwlink/?linkid=2097913.
Additional information
The text was updated successfully, but these errors were encountered: