Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Effective deadlock handling

Re: Effective deadlock handling

From: Galen Boyer <galenboyer_at_hotpop.com>
Date: 5 Jan 2004 15:02:16 -0600
Message-ID: <uisjqm7rk.fsf@standardandpoors.com>


On Mon, 05 Jan 2004, damorgan_at_x.washington.edu wrote:
> Galen Boyer wrote:
>

>> On Sun, 04 Jan 2004, damorgan_at_x.washington.edu wrote:
>>
>>>I always code it with SKIP LOCKED and trap the PK of any
>>>missed records for later processing.
>> So, the application can have logic producing deadlock
>> conditions but you put a little bit of dressing on the code so
>> the application doesn't experience the deadlock error.
>>

>
> One could say the same thing about EXCEPTION WHEN OTHERS too.

This analogy makes no sense. Here we are catching unexpected errors. Purposefully ignoring deadlock issues is bad programming.

> Just a matter of perspective. From my experience ... at least
> 50% of good code is defensive in nature.

But, your analysis of how to handle deadlocks wasn't "fix the logic of the application". Your analysis of how to handle deadlocks was to "SELECT FOR UPDATE SKIP LOCK" and then fix any errors afterwards. Thats akin to removing RI and then, after processing is done, run a query which finds orphaned children and fix them. I guess one could consider it defensive programming...

-- 
Galen Boyer
Received on Mon Jan 05 2004 - 15:02:16 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US