Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: dcrow@isis.cs.du.edu (Daniel Crow)
Subject: Record Locking in VAX/VMS Pascal
Date: Mon, 25 May 92 17:34:17 GMT	[thread overview]
Message-ID: <1992May25.173417.6599@mnemosyne.cs.du.edu> (raw)

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?

My code to perform record locked writing to the common file looks like:

...
REPEAT
	FINDK(DBH_Blackboard,0,Item.Number,ERROR:=CONTINUE);
	ErrorStatus := STATUS(DBH_Blackboard);
	CASE ErrorStatus OF
		pas$k_success: IF (UFB(DBH_Blackboard)) THEN
		BEGIN
			WRITE(DBH_Blackboard,Item);	(* Fails here *)
			UNLOCK(DBH_Blackboard);
		END
		ELSE
		BEGIN
			UPDATE(DBH_Blackboard);
			UNLOCK(DBH_Blackboard);
		END;
		pas$k_faigetloc:	(* Sleep for a few seconds, then *)
					(* Retry FINDK *)
		pas$k_errdurfin:	(* HALT program *)
	END;
UNTIL (* Succesfull FINDK *)

Any help most gratefully received (e-mail responses welcome)

Dan Crow
daniel@scs.leeds.ac.uk


             reply	other threads:[~1992-05-25 17:34 UTC|newest]

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