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: What is more costly ?

Re: What is more costly ?

From: Daniel Fink <danielwfink_at_yahoo.com>
Date: 29 Aug 2005 13:45:13 -0700
Message-ID: <1125348313.630861.89370@o13g2000cwo.googlegroups.com>


Not true. If there is a unique constraint, an uncommitted insert will block an insert of the same unique value. I don't have a 'play database' handy right now, but you can test this yourself.

Create a table with a unique constraint (say EMP.EMPNO). In session1 insert a record with a new EMPNO. In session2, insert the same record. Session2 will wait until session1 has ended it's transaction (commit or rollback). If session1 commits, session2 will get a constraint violation at that point. If session1 rollsback, session2 will return successfully and wait for the insert to be updated/deleted.

Will another session be blocked trying to insert a truly unique record? No.

This will not block any readers (of course, they won't see the new EMP record either). Received on Mon Aug 29 2005 - 15:45:13 CDT

Original text of this message

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