Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: What is more costly ?
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
![]() |
![]() |