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: Anton Eskov <anton_at_msoft.ru>
Date: Fri, 8 May 1998 10:44:37 +0400
Message-ID: <894609752.265489@telecom.lek.ru>


NO WAY :-) There is no direct way... However, you may use the following techniques to work it out:

  1. Ensure that your transaction is as fast as possible (and therefore, time for the concurrent transaction to wait is insignificant)
  2. Ensure that no records with duplicate keys are inserted (use sequences for unique key generation)
  3. Use pipes to communicate between sessions. Insert scenario may look as follows:
    • Check an appropriate pipe to see if a record with the same keys has been inserted in an open transaction
    • Issue an insert statement
    • Before Insert trigger: write keys to be inserted into the pipe
    • After commit/rollback: wipe the keys inserted during the session from the pipe

I would strongly recommend considering pp1,2 rather than 3.

SY
Anton

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 - 01:44:37 CDT

Original text of this message

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