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