From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,5a72d8b357ddea16 X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,5a72d8b357ddea16 X-Google-Attributes: gid1164f8,public X-Google-Thread: 10cc59,5a72d8b357ddea16 X-Google-Attributes: gid10cc59,public X-Google-ArrivalTime: 1992-05-26 10:32:18 PST Xref: sparky comp.lang.pascal:3547 comp.sys.dec:3168 comp.os.vms:9877 Newsgroups: comp.lang.pascal,comp.sys.dec,comp.os.vms Path: sparky!uunet!haven.umd.edu!decuac!pa.dec.com!nntpd2.cxo.dec.com!nntpd.lkg.dec.com!e2big.mko.dec.com!quark.enet.dec.com!lionel From: lionel@quark.enet.dec.com (Steve Lionel) Subject: Re: Record Locking in VAX/VMS Pascal Message-ID: <1992May26.150354.19514@e2big.mko.dec.com> Sender: guest@e2big.mko.dec.com (Guest (DECnet)) Reply-To: lionel@quark.enet.dec.com (Steve Lionel) Organization: Digital Equipment Corporation, Nashua NH References: <1992May25.173417.6599@mnemosyne.cs.du.edu> Date: Tue, 26 May 92 15:03:54 GMT 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