Pro-active Deadlock Avoidance Strategy
Is there a tool to help application developers avoid deadlock situations caused by accessing tables in an inconsistent order?
What I'm looking for is a tool that would allow me to trace the locking behavior of specific operations in my application so that I can see what resources are locked in what order. Then by comparing operations that could possibly occur in parallel, I could identify those operations that might lead to deadlocks pro-actively.
I looked at the V$LOCK view, but I'm not sure that I can guarantee that even if I order by the CTIME field that I'll be seeing the correct ordering of the lock operations. My thought would be that I could instrument my code to see what objects are locked (and in what order) by running a suitable query prior to the commit of each of the operations I want to instrument.
What I'm looking for is a tool that would allow me to trace the locking behavior of specific operations in my application so that I can see what resources are locked in what order. Then by comparing operations that could possibly occur in parallel, I could identify those operations that might lead to deadlocks pro-actively.
I looked at the V$LOCK view, but I'm not sure that I can guarantee that even if I order by the CTIME field that I'll be seeing the correct ordering of the lock operations. My thought would be that I could instrument my code to see what objects are locked (and in what order) by running a suitable query prior to the commit of each of the operations I want to instrument.
1