VSAM

 

Record Locking

Locking occurs automatically during updates or deletions of records through the use of UPDATE or DELETE SQL statements, which are implemented via the CICS READ, UPDATE, REWRITE, DELETE, and UNLOCK commands.

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, then CONNX returns an error if an attempt is made to read a VSAM file, record, or set of records within the file which has been previously locked by one or more users.

Record locking in VSAM can be triggered by setting the lock property of the statement handle to SQL_CONCUR_LOCK when issuing a SELECT command.

Implementation of this feature varies in each product.

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

 

rs.open "select customerid from customers_vsam", conn, adOpenKeyset, adLockPessimistic

 

Transactions

Transactions are supported by CONNX for VSAM via the CICS SYNCPOINT and SYNCPOINT ROLLBACK commands.

Note: These commands have no effect unless the VSAM files accessed via CONNX within the current unit of work are defined to CICS as recoverable resources.