Repository navigation
fix: add WITH (lock) clause for MSSQL select with join queries - #8507
Conversation
88f10b4 to
4d6d19f
Compare
typeorm didn't supported LOCK clause in SELECT + JOIN query. For example, we cannot buld SQL such as "SELECT * FROM USER U WITH(NOLOCK) INNER JOIN ORDER WITH(NOLOCK) O ON U.ID=O.UserID". This pull request enables LOCK with SELECT + JOIN sql query. Closes: typeorm#4764
4d6d19f to
893af06
Compare
a62ec08 to
5607bdd
Compare
|
Any plans on when to merge this? I think this would solve a lot of my problems! |
|
Looks like a breaking change? What is the difference between locks being set on |
|
I think this pull request only effects on MSSQL Driver. In summary, In MSSQL, although we set
|
|
For your question, this link is relevant to answer. |
|
Any updates on this pull request ? |
|
thank you for contribution! |
Typeorm didn't supported LOCK clause in MSSQL SELECT + JOIN query.
For example, when we write code with typeorm like this
we would expect the corresponding SQL of this statement is
but typeorm generates SQL like this
This pull request enables LOCK with SELECT + JOIN sql query.
This pull request will prevent deadlock situations while querying SELECT statements during transactions. (in case of MSSQL Driver)
Closes: #4764
Description of change
Pull-Request Checklist
masterbranchnpm run lintpasses with this changenpm run testpasses with this changeFixes #0000(N/A)Documentation has been updated to reflect this change