[User Login Times] Row gets locked and can timeout when there are many sessions#4612
Merged
[User Login Times] Row gets locked and can timeout when there are many sessions#4612
Conversation
nikolakukrika
approved these changes
Aug 28, 2025
onbuyuka
approved these changes
Aug 28, 2025
miljance
pushed a commit
to miljance/BCApps
that referenced
this pull request
Oct 22, 2025
…y sessions (microsoft#4612) <!-- Thank you for submitting a Pull Request. If you're new to contributing to BCApps please read our pull request guideline below * https://github.com/microsoft/BCApps/Contributing.md --> #### Summary <!-- Provide a general summary of your changes --> When there are many sessions, fx, Web Service calls, this code which checks if it's the first time a login has happened can cause deadlocks. As many sessions hitting the DB at the same time would all need to wait for one another. A lock is held on that specific row every time the IsEmpty check is done. ReadUncommited will ensure no lock is held and even if the data is being updated, we then know that the user has logged in previously. #### Work Item(s) <!-- Add the issue number here after the #. The issue needs to be open and approved. Submitting PRs with no linked issues or unapproved issues is highly discouraged. --> Fixes [AB#598794](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/598794)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When there are many sessions, fx, Web Service calls, this code which checks if it's the first time a login has happened can cause deadlocks. As many sessions hitting the DB at the same time would all need to wait for one another.
A lock is held on that specific row every time the IsEmpty check is done. ReadUncommited will ensure no lock is held and even if the data is being updated, we then know that the user has logged in previously.
Work Item(s)
Fixes AB#598794