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: Oracle Select/Insert Locking

Re: Oracle Select/Insert Locking

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Tue, 10 Feb 2004 06:38:40 -0800
Message-ID: <1076423870.503664@yasure>


M2 wrote:

> I actually just noted that I said that "Process 2 inserts", I should have
> said "tries to insert" as it actually causes a constraint violation and
> doesn't success (as you'd expect). This is trapped in the code and causes no
> dire consequences I just don't like the design that relies on this as the
> trap.
>
>
> "M2" <m2_at_nowhere.com> wrote in message
> news:M9%Vb.576$KW.36672_at_news.optus.net.au...
>

>>Perhaps I misexplained myself. This DOES use a sequence and they ARE

>
> unique
>
>>(as mentioned they're the primary key after all). Regardless, I do not
>>understand how this actually relates to my problem as it' essentially

>
> about
>

>>how to avoid a race condition.

I understand English may not be your first language but either your description is inadequate or the problem you describe impossible.

If an insert consists of two columns, MESSAGE_ID and USERNAME, and MESSAGE_ID is unique because it is sequence generated there is no constraint conflict possible. Just insert the things as fast as the machine will allow. There is nothing to check until you run out of disk space.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Tue Feb 10 2004 - 08:38:40 CST

Original text of this message

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