0
votes

I have a strange thing going on that i suspect is related to transaction scope within nservicebus, but thought i should ask before i go off in the wrong direction.

Here is my issue: I have an endpoint hosted in an azure worker role, talking with azure queues for the transport. I am doing very simple database writes in a few of my handlers using entity framework 5 against sql server 2012. Everything is just great and all works until i scale out the worker role to more than one instance.

When i do that i start getting sporadic deadlock errors: Error 1205 : Transaction (Process ID) was deadlocked on resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

Should i be looking at changing the default isolation level in my endpoint, or am i looking in the wrong direction here.

I have ran explain plains on all statements so i am sure there are no full scans, and the database is not under load; the only variable that seems to cause this is scaling out horizontally with more instances in azure.

1
nsb3 didn't change the default scope which means that you are on serializable. nsb4 will default to readcommitted (github.com/NServiceBus/NServiceBus/issues/656). So try to change the isolationlevel and see if that helps(Configure.IsolationLevel(...)) - Andreas Öhlund
yep, that was the issue. Thank you!!! - chutch

1 Answers

0
votes

Changing the default isolation mode to read committed resolved the issue. Thanks!