Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: INSERT WITH "NOWAIT"

Re: INSERT WITH "NOWAIT"

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Fri, 08 May 1998 19:58:33 GMT
Message-ID: <01bd7abb$75203540$0300a8c0@WORKSTATION>

I haven't thought this one through - but how about trying something with the dbms_lock package.

Wrap each insert in a procedure that gets a unique lock id and tries to take out an exclusive lock on that lock id with nowait. if it succeeds it inserts the row, if not someone else has inserted the row but you get an immediate return.

> Stephanie Panagopoulos wrote in message
> <355197BE.FC17E101_at_UNIXFOR.ATH.FORTHNET.GR>...
> >Could you please help us with the follow problem.
> >
> >Table A has two keys.
> >Field pk is a primary key and uk is a unique key.
> >
> >A session inserts into A the record (pk_vall, uk_vall)
successfully.
> >The session does not commit the insertion.
> >Another session does attempts to insert the same record and
because
> >there is
> >the uncommitted previously inserted record from another session
has to
> >wait until
> >the first session execute a commit or a row back releasing the
row-lock.
>
Received on Fri May 08 1998 - 14:58:33 CDT

Original text of this message

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