TMF Application Programmer's Guide (G06.24+)
TMF Programming Environment
HP NonStop TMF Application Programmer’s Guide—522419-004
1-15
Enscribe Capabilities
with the same character sequence as the key of the referenced record. Generic 
locking applies only to key-sequenced files.
•
READLOCK and READUPDATELOCK lock the record before reading it.
•
WRITE locks the record that is being inserted.
•
UNLOCKREC unlocks the current record (as determined by the most recent 
operation against the file). If generic locking is enabled for a key-sequenced file, 
calls to UNLOCKREC are ignored.
•
UNLOCKFILE, ENDTRANSACTION, ABORTTRANSACTION, and CLOSE unlock 
all records that were locked through the transaction identifier associated with the 
call.
Note that locks on records that were read but not altered are released immediately; 
locks on inserted, updated, or deleted records, however, are never released until the 
transaction is either committed or aborted and backed out. 
Unlike NonStop SQL/MP, all locks for Enscribe files are exclusive locks. Enscribe does 
not support shared locks (locks whose ownership is claimed jointly by two or more 
transactions).
Ensuring Level-1 Consistency
There are three ways that the DP2 disk process ensures level-1 consistency for 
audited Enscribe files.
Whenever a transaction inserts a new record into an audited file, the disk process 
automatically obtains a lock based on the inserted record’s primary-key value. This 
lock prevents another transaction from inserting a record with the same primary key 
value as the newly inserted record, and from reading, locking, updating, or deleting the 
newly inserted record.
Before a transaction can update or delete an existing record in an audited file, the 
transaction must first lock either the record or its file. If the transaction has not 
obtained an appropriate lock, the attempt to update or delete the record is rejected 
immediately with a condition code of CCL and an error 79.
The disk process retains all locks on inserted, updated, or deleted records in audited 
files until the associated transaction is either committed or aborted and backed out.
Locking Modes
Enscribe provides six locking modes that determine what action occurs if you try to 
lock a file, or read or lock a record, when the file or record is already locked. Table 1-1 
summarizes each mode. You use SETMODE 4 procedure calls to select the desired 
locking mode.
Note that the Enscribe locking modes apply only to read and lock requests. If you 
issue a WRITE request (to insert a new record) and the target file is locked by a 
different transaction identifier, the request is rejected with a condition code of CCL and 










