TurboIMAGE/XL Database Management System Reference Manual MPE/iX V6.5 (30391-90011)
320 Chapter7
Logging and Recovery
Dynamic Roll-Back Recovery
failed. As the application designer, you should be very cautious when taking this
option as the modification to the database in this intrinsic did not take place.
6. Call DBXEND to declare the end of the modifications. If DBXUNDO was used in step 4 to
roll back a transaction, your program logic should ensure that the subsequent call to
DBXEND is not processed.
7. Call DBUNLOCK to release all of the locks.
Dynamic roll-back requires strong locking as discussed previously under "Locking and
Dynamic Transactions." Calling DBUNLOCK after a call to DBPUT, DBDELETE, or DBUPDATE
within a dynamic transaction will return an error because the call to DBUNLOCK must occur
after the call to DBXEND. If necessary locks are not acquired before calling DBXBEGIN,
covering locks must be used on the intrinsic calls within the dynamic transaction,
otherwise an error will be returned.
It is essential that you check the status after each intrinsic. If a database intrinsic fails,
you may end the transaction by calling DBXEND or roll back the entire transaction by
calling DBXUNDO. You may be able to continue with the transaction despite the intrinsic
failure, however, you must account for the intrinsic failure. The outcome varies based on
your application design.
Do not use DBCLOSE mode 1 (close the database) inside an active dynamic transaction. This
use of DBCLOSE will cause your dynamic transaction to be rolled back, the locks will be
released, the database will be closed, and subsequent use of DBXEND or DBXUNDO will return
an error.
If your dynamic transaction is very long causing XM to reach its limit of the log buffer
space allowed per process, it will become a stalled transaction, and you cannot continue
any further. This stalled transaction will be rolled back and the process is terminated.
If the system aborts or TurboIMAGE/XL encounters an internal error, the active memo
records are saved in a file. All of the unrecovered memo records for a particular database
are held in the
dbname
00 file. It resides in the same group and account as the database,
and each database has only one
dbname
00 file. The first DBOPEN of an unrecovered database
initiates the recovery using the
dbname
00 file.
User logging (discussed later in this chapter) is not required for dynamic roll-back
recovery, but it is recommended to guard against a media failure.