-
Notifications
You must be signed in to change notification settings - Fork 200
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
Throw a specific exception for deadlocks #11
Comments
Hi @oliverhanappi thank you for your interest in the library. I'm curious whether you've ever seen the deadlock exit code returned. I remember trying to force this a while back and not seeing it. Provided we can create a test case where this is actually returned, this suggestion makes sense and would be an easy enhancement. For backwards compat, the new exception should extend |
It is actually pretty easy. You just need to acquire multiple locks within the same connection or transaction such that two connections/transactions are waiting on each other. Here is a simple repro:
|
Address #11 by throwing a specific exception type (DeadlockException)…
This is addressed as of version 1.4 |
The method
SqlApplicationLock.ParseExitCode
throws anInvalidOperationException
when a deadlock is detected. It would be very useful if a specific exception would be thrown.The text was updated successfully, but these errors were encountered: