![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||||
| |||||
|
|
Process (Familyid 33 33) (suid 4) was executing a SELECT command in the procedure 'get_event'. SQL Text: exec get_event 1088419472, '1', 6646647 Process (Familyid 52 52) (suid 4) was executing a INSERT command in the procedure 'send_event'. SQL Text: exec send_event 'ACTAB34rty02',3597,'md_rrwd0101_030_com','md_rrwd 0101_000_box','ACT',10,101,4,0,1088419472,0,'geit' ,0,0,338751,1,'',0 Process (Familyid 0, Spid 52) was waiting for a 'next key' lock on row 5 page 977 of the 'event' table in database 7 but process (Familyid 3 3, Spid 33) already held a 'shared row' 'range' lock on it. Process (Familyid 0, Spid 33) was waiting for a 'shared row' lock on row 7 page 979 of the 'event' table in database 7 but process (Familyid 52, Spid 52) already held a 'exclusive row' lock on it. Process (Familyid 0, 33) was chosen as the victim. End of deadlock information. Configuration: 1. deadlock checking period = 5000 2. Table EVENT, datarow locking, clustered index, about 20 - 40 records 3. Daemon triggering stored procedure a. 'get_event', retrieving all records from EVENT every 3 minutes in one transaction at isolation level 3 |
|
b (for each row in this selection, a processes on some remote Sybase Servers is triggered) |
|
c. prompted by the information coming back from the remote processes, 'send_event' is started, selecting and evaluating some fields from EVENT, then inserting a new record into it |
|
String of events on the local Sybase server, which ends in deadlock: 1. get_event, selecting all rows from EVENT (family 33 spid 33) 2. send_event, inserting a new row on EVENT (Family 52 SPID 52) 3. again send_event, of which the SELECT on EVENT table waits for the 'next key lock'. 4. Finally, three seconds have passed, so another get_event is triggered although the INSERT actions based on the first one haven't finished yet. |
|
Do I jump to conclusions when I state, that it is the relentlessly scheduled SELECT, triggered by the daemon irrespective of whether the preceding SELECT has finished, caused the deadlock situation? |
#3
| |||||||||
| |||||||||
|
|
I assume you mean 3 minutes pass? No, 3 seconds really!!!! |
|
The deadlock, as I've mentioned above, is between the get_event process and the send_event process. You're absolutely rigth, I misread the deadlock error message |
|
Now, which of the get_event processes is involved (the first or subsequent) ... *shrug* ... can't tell from what you've posted. That's the frustrating part of it. And because it's an thirdparty |
|
- why the need for the isolation level 3 locks? is this an attempt to keep other processes from reading the table? if so, there are other less restrictive means of doing this Right, but they choose transaction level 3 and stick to it (already |
|
get_event process is the only one to access the event table ... eh? |
|
- since the send_event may initiate the need for a change to the event table, this would appear to be contrary to what the isolation level 3 lock is designed to do (ie, *NOT* allow any changes to the event table); which is it ... allow changes to the event table or not? |
|
- the send_event processing should, most likely, be conducted over the same connection as the original get_event; this'll eliminate the deadlocking issue in this case Yes, that would do the trick, I suppose. Already asked the software |
|
Although there are a couple ways to do this ... the easiest, especially since you appear to have just one work-flow process, would be to set the event table up as a queue (heap table). |
|
Couple other options come to mind ... but I digress, eh? |
#4
| |||||
| |||||
|
|
I assume you mean 3 minutes pass? No, 3 seconds really!!!! |
|
Now, which of the get_event processes is involved (the first or subsequent) ... *shrug* ... can't tell from what you've posted. That's the frustrating part of it. And because it's an thirdparty application, I cannot look into its source. I can try some auditing of course... |
|
- the send_event processing should, most likely, be conducted over the same connection as the original get_event; this'll eliminate the deadlocking issue in this case Yes, that would do the trick, I suppose. Already asked the software company if there is any possibility to do so. |
|
Although there are a couple ways to do this ... the easiest, especially since you appear to have just one work-flow process, would be to set the event table up as a queue (heap table). So no indexing, just plain data you mean= |
|
Couple other options come to mind ... but I digress, eh? No, it is very instructive, actually. |
#5
| |||
| |||
|
|
Is it intended that this software package have multiple copies of itself running at the same time? or was it designed to only have one copy running at a time? If the latter ... someone goofed ... the second copy should be exiting if it finds a previous copy still running. |
![]() |
| Thread Tools | |
| Display Modes | |
| |