Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm seeing a few SQL deadlocks and wanted to ask if its something which we're doing wrong?
We're calling 2 methods one after another. Both of which create their own unit of work using the IUnitOfWorkProvider and call the Complete() method on each unit of work.
The deadlock exception is thrown in Method1.
The site receives quite high traffic and is hosted in Azure. Database is an S2 database (as per Umbraco's recommendations). Running Umbraco v8.10.1, Vendr v1.5.2.
Any ideas what could be causing this?
It’s hard to say completely without knowing what’s happening in Method1 and Method2, but assuming they do something that touches the same DB table, it’s highly likely under load that this will result in a deadline in your current setup.
Because each method is running in its own uow, rather than a shared one, you probably have someone with an open transaction in one method needing the resource and someone with an open transaction in the other also needing it and so you get a deadlock.
Generally speaking, you’d usually want a single transaction or uow per request (nested uow are fine as they join the same transaction). This ensures that it can’t even attempt any single action unless it can access the resources and should prevent the deadlock.
So yea, it’s likely miss-use of uow’s can cause a deadlock, but I can’t really say where without more info.
Hope this helps
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted