Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: lionel@quark.enet.dec.com (Steve Lionel)
Subject: Re: Record Locking in VAX/VMS Pascal
Date: Tue, 26 May 92 15:03:54 GMT	[thread overview]
Message-ID: <1992May26.150354.19514@e2big.mko.dec.com> (raw)
In-Reply-To: 1992May25.173417.6599@mnemosyne.cs.du.edu


In article <1992May25.173417.6599@mnemosyne.cs.du.edu>, dcrow@isis.cs.du.edu 
(Daniel Crow) writes:
|>
|>I am working on a program written in VAX/VMS Pascal V4.2 that needs to use
|>record locking on Keyed, Indexed files. I am getting duplicate key field
|>errors when I run my system and I am not sure why. There also seems to be
|>some inconsistency between the Pascal Language Reference Manual and the
|>Pascal Reference Supplement for VMS Systems manual: one implies that record
|>locking is supported if SHARING:=READONLY in the OPEN procedure, the other that
|>record locking is only supported if SHARING:=READWRITE. Which is correct?
|>
[code omitted]

I am not familiar with the second document you refer to, but the correct
answer is that record locking does not occur if SHARING:=READONLY is
specified.

As for the error you're getting, "duplicate key field", this means that
the record you are specifying in the WRITE contains a key which duplicates
that of an existing record and that duplicate keys for that index are
disallowed.  I don't see any clues in the program fragment you posted, but
I'd suggest checking carefully the contents of "Item" and also look to
see if duplicate keys are disallowed on any of the indexes of the file.

By the way, the UNLOCK calls in your example are unnecessary - the current
record will automatically be unlocked after a WRITE or UPDATE.
--

Steve Lionel                    lionel@quark.enet.dec.com
Languages Group
Digital Equipment Corporation
110 Spit Brook Road
Nashua, NH 03062


      reply	other threads:[~1992-05-26 15:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-05-25 17:34 Record Locking in VAX/VMS Pascal Daniel Crow
1992-05-26 15:03 ` Steve Lionel [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox