Re: How to do pessimistic locking in oracle with vb4

From: Dave Lindquist <lindquid_at_cadvision.com>
Date: 1996/11/16
Message-ID: <lindquid-1611961455200001_at_agtg46.cadvision.com>#1/1


In article <328C8BC2.57D7_at_generation.net>, Eric Leblanc <infosile_at_generation.net> wrote:

>I'm accessing an oracle 7.1 database in vb4, using an openlink lite
>driver. I use a resultset to do some editing on a table. When a user
>edit a record, I want this record to be locked, so the other users can't
>modify this record. I tried to open my resultset with the rdConcurLock
>locktype, but I received the error :
>S1C00 : [Microsoft][ODBC Cursor Library] Cursor library not capable

Don't know what your method of data access looks like, but why not:

SELECT
   <fields>
FROM
   <tables
FOR UPDATE NOWAIT which will give you write-lock on the records you are selecting for the duration of your transaction set (Oracle locks are destroyed when the transaction set is committed or rolled back).

Remember that pretty much any query begins a transaction set if one is not already open.

--
Dave Lindquist           <mailto:lindquid_at_cadvision.com>

"...Thank you for purchasing Windows '95.  Among the many
 refinements, you will notice the finely recrafted GPF
 dialog.  Since GPF's have now become an integral part
 of our operating system, we felt it important for users
 to be presented with a professional warning of system
 failures.  This change represents our commitment to
 quality software..."
Received on Sat Nov 16 1996 - 00:00:00 CET

Original text of this message