TMF Application Programmer's Guide (G06.26+)

TMF Programming Environment
HP NonStop TMF Application Programmer’s Guide522419-005
1-14
Enscribe Capabilities
been updated. A likely sequence of SQL statements for performing this operation
would be as follows:
UPDATE passenger
SET flight-number = 701
WHERE flight-number = 429
FOR REPEATABLE ACCESS;
With both REPEATABLE and STABLE access, every row that has been updated is
protected against being deleted or changed by any other active transaction.
With STABLE ACCESS, however, another transaction could insert a new passenger
row into the processed portion of the table while the first transaction is still in progress.
If that were to happen, the table will not end up in a consistent state. With
REPEATABLE ACCESS, that type of conflict cannot occur because REPEATABLE
ACCESS prevents other transactions from updating, deleting, or inserting anything
within the entire range of rows that has been accessed.
There are other ways that an application could approach this particular problem, but
the example clearly illustrates a major advantage of REPEATABLE ACCESS over
STABLE ACCESS.
BROWSE ACCESS
BROWSE ACCESS, sometimes referred to as “level-1 consistency,” applies only to
read operations, allowing you to read through any type of existing lock. This means
that you can gather information without waiting for the results of other transactions to
commit; you would use BROWSE ACCESS, for example, if you want to generate an
interim report very quickly. However, it also means that the data you read might be in
transition or might even disappear altogether if another transaction aborts.
BROWSE ACCESS provides the least impact on other active transactions in that it
imposes no locks on the rows that you read.
Enscribe Capabilities
Both NonStop SQL/MP and Enscribe guarantee level-1 consistency: no other
transaction can delete or update any rows or records that you have inserted, updated,
or deleted until your transaction commits or is backed out.
Unlike NonStop SQL/MP, Enscribe does not provide access options but rather a set of
locking mechanisms with which you can approximate level-2 or level-3 consistency.
With Enscribe, you use the following system procedures to lock and unlock files, sets
of records (for key-sequenced files using generic locking), or individual records:
LOCKFILE locks an entire file.
LOCKREC locks the current record, as determined by the most recent operation
against the file. If generic locking is enabled for a key-sequenced file, the
LOCKREC procedure also locks any other records in the file whose keys begin