Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Unique index behavior question
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
![]() |
![]() |