Hi,
Does anybody know how I can check if the statement SET
DEADLOCK_PRIORITY LOW has been correctly executed?
I have 2 sessions and one of them gets always the deadlock and I want
to get the deadlock on the other one. So on the other one I execute
the statement SET DEADLOCK_PRIORITY LOW. But unfortunately, the first
one still gets the deadlock.
Thanks,
Ester
Ester
It should work as it is described in the BOL
But , you might want ot check a design of the app in order to prevent
DEADLOCKs happening.
http://www.sql-server-performance.com/deadlocks.asp
"Ester" <e_gro@.hotmail.com> wrote in message
news:327f52e1.0411150147.90f5eae@.posting.google.co m...
> Hi,
> Does anybody know how I can check if the statement SET
> DEADLOCK_PRIORITY LOW has been correctly executed?
> I have 2 sessions and one of them gets always the deadlock and I want
> to get the deadlock on the other one. So on the other one I execute
> the statement SET DEADLOCK_PRIORITY LOW. But unfortunately, the first
> one still gets the deadlock.
> Thanks,
> Ester
|||Ester,
SQL Server will kill the transaction which costs less to terminate. In other
words, the deadlock_priority option does not guarantee that your second
session always gets terminated, it only lowers the cost. You should use
careful database and procedure design together with transaction isolation
levels / locking hints instead, to avoid getting the deadlock situation at
all.
Jon Jahren
"Ester" <e_gro@.hotmail.com> wrote in message
news:327f52e1.0411150147.90f5eae@.posting.google.co m...
> Hi,
> Does anybody know how I can check if the statement SET
> DEADLOCK_PRIORITY LOW has been correctly executed?
> I have 2 sessions and one of them gets always the deadlock and I want
> to get the deadlock on the other one. So on the other one I execute
> the statement SET DEADLOCK_PRIORITY LOW. But unfortunately, the first
> one still gets the deadlock.
> Thanks,
> Ester
|||Hi,
thank your input.
After further testing I learned I described the situation too short.
First I must said unfortunately that I cannot change the functions
that are causing the deadlock. I understood that that is the normal
way, but I must live with this situation.
In the application I use I cannot execute sql statements directly so I
put the SET DEADLOCK_PRIORITY LOW in an update trigger of a table.
After your input I tested this directly in the query analyser
and came to the following conclusions:
-when I execute the statement SET DEADLOCK_PRIORITY LOW directly in
the second sessions, this session gets the deadlock as is expected
-but when I call the statement through the update trigger (in an
seperated batch), the statement has no effect.
Can you give me information if my findings are correct and maybe about
another way to get what I want?
Thanks,
Ester
e_gro@.hotmail.com (Ester) wrote in message news:<327f52e1.0411150147.90f5eae@.posting.google.c om>...
> Hi,
> Does anybody know how I can check if the statement SET
> DEADLOCK_PRIORITY LOW has been correctly executed?
> I have 2 sessions and one of them gets always the deadlock and I want
> to get the deadlock on the other one. So on the other one I execute
> the statement SET DEADLOCK_PRIORITY LOW. But unfortunately, the first
> one still gets the deadlock.
> Thanks,
> Ester
No comments:
Post a Comment