![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
We're currently experiencing deadlocks with a production application. With the volume of transactions that we get, this behavior is not completely unexpected. What we would like to do is trap the deadlock, wait, and re-submit. We are having difficulty trapping the deadlock from within the application, so what I'm looking for is a way to create a deadlock using stored procedures to be able to simulate what happens in our production code. I'm somewhat of a newbie to ASE (it's been 9 years since I last worked with Sybase). I need two procs where I can create a window large enough to create the right sequence of events in order to trigger the deadlock. Currently I have the following sequence of events: 1. Proc A requests select-lock on page 2. Proc B requests exclusive-lock on same page for insert 3. Proc A requests exclusive-lock on page for update of previously selected row. Is there a way to "pause" a stored proc long enough to start my second process to create the deadlock scenario? Is there a function that I can invoke which effectively makes a procedure "sleep" for a while? I know that usually code is written to be fast and efficient, but maybe there's a way to induce this behavior through what otherwise might be considered bad/sloppy coding practices. Your help is greatly appreciated! Evan |
#3
| |||
| |||
|
|
[. . .] so what I'm looking for is a way to create a deadlock using stored procedures to be able to simulate what happens in our production code. |
#4
| |||
| |||
|
#5
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |