[an error occurred while processing this directive]

HP OpenVMS Systems

ask the wizard
Content starts here

Determining RMS record lock holder?

» close window

The Question is:

 
We receive a record lock message from our programs when multiple users are
attempting to update the same record in a file. I would like to be able to
inform the user of who is keeping them out of the record. To date I have
been unable to find any procedur
e that will return the PID or userid of the process holding the lock. Does
the RMS return or store this userid information anywhere when it returns the
locked record status?
 
Thank You
 
 


The Answer is :

 
  RMS makes no attempt to determine who is blocking whom, and thus does
  not and will not return that information.
 
  The RMS record lock resources are not documented, but the current
  implementation is easy enough to figure out: the target record RFA under
  the file lock -- see the _VMS File System Internals_ and/or the _Internals
  and Data Structures Manual_ for details.  This mechanism and these lock
  names may change in some future release, but that change is currently
  viewed as rather unlikly.  Based on this lock name, it is possible for
  an application to sift through SYS$GETLKI data, using the RFA returned
  from a $GET or $FIND with ROP=RRL.
 
  The OpenVMS Wizard prefers to simply us a program with which waits for the
  target lock to become free (ROP=WAT) and then use ANALYZE/SYSTEM SHOW
  PROCESS /LOCK command on the now-blocked process to figure out the current
  lock holder.  Other options include using DECamds or Availability Manager
  to locate the lock-holders, and the simple expedient of re-coding the
  application(s) to use a timeout mechanism to prevent a particular lock
  from being held too long.
 

answer written or last revised on ( 15-NOV-1999 )

» close window