-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
Why subquery is generated for UPDATE #701
Comments
Hello @PatryxCShark , Improving this is something in our backlog. Unfortunately, time is missing so we never succeed yet to find time to do such a request. We will eventually do it but we currently have more requests than we can handle so we cannot do it at this moment. To fix your issue at this moment, the only way to solve it is using the x => { x.Executing = command => commandText = command.CommandText; x.UseTableLock = true }); Best Regards, Jon Sponsorship Performance Libraries Runtime Evaluation |
I understand @JonathanMagnan. |
Hello @PatryxCShark , The You can also use the |
UseRowLock doeas not work properly, but TABLOCK seems to be OK. Will I still need to use Tablock to have guarantee that no one else will change the same records? |
We cannot guarantee if it will still require it or not. However, there will for sure have less chance of lock/block. Unfortunately, simplifying the query generation to make an update like this one is currently not in our short-term plan (this request is harder than it looks and we currently have more requests than we can handle). |
Thank you @JonathanMagnan for supporting. Good luck! |
Hi,
I want to ask about your example why such UPDATE generates subquery:
as follows:
Fiddle:
https://dotnetfiddle.net/a6zJUe
Why not just query (with WHERE added if required):
Any idea what is the purpose?
What's more now I have problem with concurrency: more than one query at the same time can modify the same rows because if there is a WHERE to choose which records to update, it updates them based on old values.
Any idea how to reolve this problem?
I use version:
Z.EntityFramework.Plus.EFCore 2.2.13
The text was updated successfully, but these errors were encountered: