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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Unique index behavior question

Re: Unique index behavior question

From: Myron Wintonyk <Myron.Wintonyk_at_UAlberta.ca>
Date: Sat, 24 Mar 2001 17:40:54 +1000
Message-ID: <99hj6d$4oe$1@kraken.itc.gu.edu.au>

Actually, the second user will not be able to insert that value into the table
and it will just wait for a lock. If the first user commits, then the second
user gets an error. If the first user rolls back, the second users insert goes
forward.

"Daniel A. Morgan" <dmorgan_at_exesolutions.com> wrote in message news:3ABC2DD0.9B204990_at_exesolutions.com...
> > Let's say a table has a column, call it A, that has a unique index on
> > it.
> >
> > Client 1 and client 2 start transactions. Client 1 adds or updates a row
> > in the table with a particular value for column A. Then, client 2 tries
> > to add or update a different row using the same value for column A, and
> > does so before client 1 commits its transaction.
> >
> > Will client 2 receive an immediate error when it attempts to make its
> > change, or will the error occur when the clients commit their
> > transactions? Will the last client that commits receive the error, or
> > the last client to perform the update?
>
> Nothing happens until a commit is issued.
>
> Whoever commits first wins.
>
> Whoever commits second loses.
>
> Daniel A. Morgan
>
Received on Sat Mar 24 2001 - 01:40:54 CST

Original text of this message

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