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

Home -> Community -> Usenet -> c.d.o.server -> Re: deadlocks between single update statements ?

Re: deadlocks between single update statements ?

From: DA Morgan <damorgan_at_psoug.org>
Date: Sat, 23 Sep 2006 09:14:43 -0700
Message-ID: <1159028082.159253@bubbleator.drizzle.com>


Jonathan Lewis wrote:

> <hasta_l3_at_hotmail.com> wrote in message 
> news:1159000862.384129.73710_at_i3g2000cwc.googlegroups.com...

>> Dear group,
>>
>> Assume a transaction A with a single update statement updating many
>> rows of a table.
>> Assume another transaction B also with a single update, concurrently
>> updating the same rows, but perhaps in a different order.
>>
>> Can these single updates deadlock ?
>>
>         If the row updates are in exactly the same
>         order, the second transaction will wait for
>         the first transaction to commit or rollback.
> 
>         If the row updates are in a different order
>         you will get a deadlock.
> 

>> How do you prevent this ?
>>
> 
>         a) Serialize the two updates
>         b) Program for deadlock detection so that
>             you can rollback and retry.
> 

>> Thanks much.

Why not SELECT FOR UPDATE SKIP LOCKED?

-- 
Daniel Morgan
University of Washington
Puget Sound Oracle Users Group
Received on Sat Sep 23 2006 - 11:14:43 CDT

Original text of this message

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