Using the BEGINLOG and ENDLOG Intrinsics [ User Logging Programmer's Guide ] MPE/iX 5.0 Documentation
User Logging Programmer's Guide
Using the BEGINLOG and ENDLOG Intrinsics
To take full advantage of the data protection of User Logging, a logical
transaction should be defined for the application. All actions that must
be performed together for data to be in a consistent state should be
included. In case the transaction is interrupted, the beginning and end
of each transaction should be marked allowing fully and partially
completed transactions to be identified.
The BEGINLOG intrinsic writes a special record to the logfile, marking
the beginning of a logical transaction. When BEGINLOG is used, the User
Logging memory buffer is flushed to ensure the record gets to the
logfile. A BEGINLOG record with no data can be written to mark the
beginning of a transaction, or data may be included (refer to the
WRITELOG intrinsic). Including data allows the user to include
information about the entire logical transaction, or to mark the
beginning of the logical transaction and write the first log record with
a single intrinsic call.
NOTE The WRITELOG intrinsic may be used to write logging records for
each action within the transaction.
ENDLOG contains the same information as BEGINLOG except it marks the end
of a transaction. ENDLOG may be called with or without data, and it
flushes the User Logging memory buffer to ensure the record gets to the
logfile.
BEGINLOG and ENDLOG pairs may be nested within other pairs and may be
called any number of times. User Logging does not keep track of matching
BEGINLOGs and ENDLOGs; it is the user's responsibility to ensure they are
properly matched. If they are not matched, they will not be useful in
recovery.
MPE/iX 5.0 Documentation