Re: "NOWAIT"
Date: Fri, 08 May 1998 00:00:22 -0700
Message-ID: <3552AD86.CA6C9211_at_u.washington.edu>
It is alway possible to execute the commit command within the code
controling the form. The
major problem with this is how to know when to commit. How many fields, etc.
Trapping all
of the various events (next field, next block, loss of focus, etc) is very
time consuming.
Of course after you do this it is still possible the two people will
basically enter the record
nearly simultaneously, thus overcoming all the code you wrote.
A simple solution would be to use a sequence to populate the primary key.
When ever a new record
is create the sequence number is called and inserted. Once a sequence number
is used, no one
else can get it. Even near simultaneous access, the server will answer one
request first. Again
unique. The major drawback is that the sequence numbers will be used even
when no record is
inserted.
Mike Krolewski
Stephanie Panagopoulos wrote:
> 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.
>
> We want to change the above scenario.
> What we want is to make each session attempting to insert a record to be
> able to
> understand that at the specific moment a row-lock for the specific row
> exists and
> abort the insertion immediately.
>
> We may say we need a "NOWAIT" behavior for the insert operation.
>
> Which is the best method we can accomplish what we need ?
> ( We are looking for a work-around solution)
>
> Thank you very much
>
> Nicholas Economou
Received on Fri May 08 1998 - 09:00:22 CEST