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: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 29 Aug 2005 15:15:38 -0700
Message-ID: <1125353688.277896@yasure>


Daniel Fink wrote:
> 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).

You are absolutely correct. I knew it at some point in time but age or brain cell death stripped it from my memory a few days ago.

Thanks for setting the record straight.

No scotch for me tonight.

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Mon Aug 29 2005 - 17:15:38 CDT

Original text of this message

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