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: How does unique index work?

Re: How does unique index work?

From: Noel <tbal_at_go2.pl>
Date: Fri, 5 Dec 2003 09:14:02 -0000
Message-ID: <bqpeju$a9q$1@inews.gazeta.pl>

Uzytkownik "John" <jbradshaw777_at_yahoo.com> napisal w wiadomosci news:f2f59d82.0312041739.524c7394_at_posting.google.com...

> Let's say there are 2 insert sessions going against the same table
> concurrently. One session should check for uniqueness by scanning the
> rollback generated by the other (for those modified blocks), right?
> But each session will not scan its own rollback data.

Hello,
 One of those sessions will have to wait for commit, couse  table will be 'locked', and released after successful commit;

An example:
CREATE TABLE A
 (
  id NUMBER,
  val1 VARCHAR2(10),
  val2 VARCHAR2(10)
  );
CREATE UNIQUE INDEX I_UQ_1 ON A(val1,val2); INSERT INTO A values(1,'AB','ABC');

Try to conect other session and insert same row... This session will wait until commit will be issued in first session, and after it error about 'violation of index' will be displayed.

--
Noel
Received on Fri Dec 05 2003 - 03:14:02 CST

Original text of this message

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