Dealing with lockwaits
Lockwaits come into picture when several processes are accessing the same objects. One process will be waiting for other to release the lock and it will be a cycle. The main process which is holding the lock dont complete, holding the lock. In this case, we have to identify the process which is holding the lock and resolve it . When the lockwaits increase, there is a probability of occurance of deadlock.
Lockwaits and deadlocks have to be resolved asap, else performance of the system will be hampered badly.
In this document, I’ll be explaining how to get rid of lockwaits.
1. Open ST04 and check for lockwaits.
In the example given here, we have 522 proceseses involved in the lockwaits
2. Keep scrolling sdown till you find the main agent(Process) that is holding the object
In this context, Agent 57446 (disp+work) waiting on Agent 16836 >> Once 16836 is completed, 57446 will proceed.
Agent 16836 (disp+work) waiting on Agent 23984 >> For 16836 to complete, 23984 should be completed.
Completion this Process will release the locks
3. Open SM66 and search with the PID related to Main Agent
4. Goto SM37 and include EXECUTING SERVER in the layout.
Filter the valus of the server obtained from SM66 related to the PID
5. From the list of jobs filtered, check which job is running with that PID. Check if the job is progressing or not at Application Server level. Try to resolve or in worst case, cancel the job.
6. Once it is cancelled, check in ST04 again and the lockwaits will be cleared in sometime.