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

TMF Programming Environment
HP NonStop TMF Application Programmer’s Guide522419-005
1-17
Enscribe Capabilities
between existing rows. While the transaction is in progress, no new rows can be
inserted within the entire range of rows accessed by the transaction.
Unless you lock an entire file, Enscribe does not provide this protection; therefore,
applications using Enscribe files can encounter what is called “the inserted record
problem.”
Consider the case in which a transaction is locking and reading a sequence of
employee records arranged in alphabetic order, using a read loop containing a
READLOCK call. When the transaction (designated T1) does its first read, the file is
as follows:
Record #1: ANN (locked by T1)
Record #2: BEN
Record #3: CHARLIE
Record #4: EDDIE
Record #5: FRANCO
EOF
When the read loop terminates, the file is as follows:
Record #1: ANN (locked by T1)
Record #2: BEN (locked by T1)
Record #3: CHARLIE (locked by T1)
Record #4: EDDIE (locked by T1)
Record #5: FRANCO (locked by T1)
EOF
At this point, another transaction inserts the record DYLAN into the file. The second
transaction can do so because T1 did not lock the entire file. The file now is as follows:
Record #1: ANN (locked by T1)
Record #2: BEN (locked by T1)
Record #3: CHARLIE (locked by T1)
Record #4: DYLAN
Record #5: EDDIE (locked by T1)
Record #6: FRANCO (locked by T1)
EOF
If T1 were then to reexecute its read loop, it would not get the same results it did the
first time.
The Deleted Record Problem
If you specify REPEATABLE ACCESS, NonStop SQL/MP prevents a transaction from
reading past rows that have been deleted by other incomplete transactions (the read
operation halts at the first deleted row until the delete is either committed or backed
out).
With Enscribe files, the SETMODE 4 normal mode and reject mode options prevent
individual reads from accessing deleted records. If you read an Enscribe file by using
a read loop, however, the read sequence always bypasses any records that are
marked as deleted (this is true even if the delete has not yet been committed);