RMS

Record locking

RMS record locking occurs at the record level, and works well with high performance and high volume applications.

Record locking in RMS is automatically used when updating or deleting records with the UPDATE or DELETE SQL statement.

During record selection, CONNX uses the RMS GET REGARDLESS flag which allows CONNX to read records locked by other applications.

Use of Get Regardless enables the user to select data currently locked by other applications. However, if data is selected with the intent to update it through the use of the SELECT .. FOR UPDATE SQL Statement, or by setting the SQL_CONCUR_LOCK property of the statement handle, an error is returned if an attempt is made to read a record locked by another user.

Locking can be triggered when issuing a SELECT statement by setting the lock property of the statement handle to SQL_CONCUR_LOCK.

Implementation of this feature varies in each product:

Here is an example of an SQL statement used for RMS record locking in Visual Basic ADO:

 

rs.Open "select customerid from customers_rms", conn, adOpenKeyset, adLockPessimistic

 

 

Locking notes for RMS programmers:

By default, CONNX will open all RMS files in using GET(FAB$M_GET) access, and

ALL(FAB$M_SHRGET|FAB$M_SHRUPD|FAB$M_SHRPUT|FAB$M_SHRDEL)


share access.

CONNX will open a file using:

UPDATE(FAB$M_GET|FAB$M_UPD),

DELETE(FAB$M_GET|FAB$M_DEL) or

INSERT(FAB$M_GET|FAB$M_PUT) access

with a share access of

ALL(FAB$M_SHRGET|FAB$M_SHRUPD|FAB$M_SHRPUT|FAB$M_SHRDEL)

ONLY when performing an insert, update or delete.

 

Additionally, CONNX uses the RMS READ_REGARDLESS flag when it issues read/only selects, which allows CONNX to read records that are locked by another application if the intent is NOT to update the data.

 

 

Transactions

CONNX can support RMS transactions if the RMS file is flagged for RMS journaling. All applications that update the file must make additional RMS system calls to control the transaction. However, if journaling is enabled on an existing RMS file used by a VMS application that has not made the program changes, the VMS application will no longer be able to update the RMS file. This feature should only be used if RMS journaling is currently in use by existing VMS applications.

To activate this feature, the following system logical must be defined in the SYS$STARTUP:SYSTARTUP_VMS.COM file:

$DEFINE /SYSTEM CNXRMSJOURNAL 1

 

To enable full transaction support for all RMS files marked Recovery Unit Journaling, the following must be added to the registry file:

[RMS]
TRANSACTION = 1

 

RMS files can be marked for Recovery Unit Journaling with the following command:

$SET FILE/RU_JOURNAL rmsfilename

 

Refer to your RMS Journaling Manual for further details about journaling.

 

Related Topics

image\CHICLET.jpg CONNX Registry File Settings