Skip to content

[User Login Times] Row gets locked and can timeout when there are many sessions#4612

Merged
darjoo merged 1 commit intomainfrom
bugs/598794
Aug 28, 2025
Merged

[User Login Times] Row gets locked and can timeout when there are many sessions#4612
darjoo merged 1 commit intomainfrom
bugs/598794

Conversation

@darjoo
Copy link
Copy Markdown
Contributor

@darjoo darjoo commented Aug 28, 2025

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

@darjoo darjoo requested a review from a team as a code owner August 28, 2025 11:10
@github-actions github-actions bot added this to the Version 28.0 milestone Aug 28, 2025
@darjoo darjoo merged commit f3d683e into main Aug 28, 2025
27 checks passed
@darjoo darjoo deleted the bugs/598794 branch August 28, 2025 13:22
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)
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.

3 participants