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

Only take app lock out at beginning of transaction #983

Open
Charles-Gagnon opened this issue Dec 5, 2023 · 1 comment
Open

Only take app lock out at beginning of transaction #983

Charles-Gagnon opened this issue Dec 5, 2023 · 1 comment
Labels
enhancement New feature or request trigger
Milestone

Comments

@Charles-Gagnon
Copy link
Contributor

Currently we call sp_getapplock at the beginning of every query we run. This shouldn't be necessary - the app locks we get are transaction level and so we only need to do that once at the beginning of a transaction. The benefit of this will mostly be to reduce the noise in the query logs - since the applock statement is a no-op after first getting it then it just clutters up the query logs (for example if an error happens).

Before doing this we need to verify that we can't get in a circumstance where the transaction is ended but queries can still execute, such as what happened here : #979 So ensuring that if an error ever occurs we rollback the transaction is critical - otherwise we could risk corruption of the state by running queries outside of a transaction (especially when that transaction was rolled back)

@Charles-Gagnon Charles-Gagnon added enhancement New feature or request trigger labels Dec 5, 2023
@Charles-Gagnon Charles-Gagnon added this to the Post GA milestone Dec 5, 2023
@JetterMcTedder JetterMcTedder added NRC and removed NRC labels Feb 9, 2024
@mpaulcvna
Copy link

mpaulcvna commented Jul 26, 2024

Any updates on this (sorry for the double-post)? We just ran into this and is causing major issues for us.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request trigger
Projects
None yet
Development

No branches or pull requests

3 participants