Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Record Locking in VAX/VMS Pascal
@ 1992-05-25 17:34 Daniel Crow
  1992-05-26 15:03 ` Steve Lionel
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Crow @ 1992-05-25 17:34 UTC (permalink / 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1992-05-26 15:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1992-05-25 17:34 Record Locking in VAX/VMS Pascal Daniel Crow
1992-05-26 15:03 ` Steve Lionel

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