HP 3000 Manuals

Using TurboIMAGE/XL Intrinsics (Continued) [ TurboIMAGE/XL Database Management System Reference Manual ] MPE/iX 5.5 Documentation


TurboIMAGE/XL Database Management System Reference Manual

Using TurboIMAGE/XL Intrinsics (Continued) 

DBXUNDO 

INTRINSIC NUMBER 422.   

Rolls back the active sequence of TurboIMAGE/XL procedure calls which are
considered a dynamic transaction.

Syntax.  [REV BEG]

DBXUNDO ,{base      } ,text,mode,status,textlen 
         {baseidlist}
[REV END]

Parameters.   

base                  is the name of the array used as the base parameter
                      when opening the database.  The first element of
                      the array must contain the base ID returned by
                      DBOPEN. (Refer to DBOPEN for more information about
                      the base ID.)[REV BEG]

baseidlist            Name of the integer array containing the base IDs
                      of the databases which are involved in the DMDBX.
                      Use the same baseidlist parameter of DBXBEGIN mode
                      3, when calling DBXUNDO to roll back a DMDBX.[REV
                      END]

text                  is an array up to 256 halfwords long that contains
                      user ASCII or binary data to be written to the log
                      file as part of the DBXUNDO log record.[REV BEG]

mode                  Must be a halfword equal to 1 when employing base 
                      as the base parameter or 3 when using baseidlist 
                      with the matching DBXBEGIN call.

                      Mode 1:    Dynamically roll back DBPUT, DBDELETE,
                                 and DBUPDATE intrinsics which completed
                                 successfully since the matching DBXBEGIN
                                 mode 1 call.

                      Mode 3:    Dynamically roll back DBPUT, DBDELETE,
                                 and DBUPDATE intrinsics which completed
                                 successfully inside the DMDBX to their
                                 respective databases since the matching
                                 DBXBEGIN mode 3 call.  If user logging
                                 is enabled for the databases, mode 3
                                 generates multiple entries in the log
                                 file, one for each database, in order to
                                 mark the roll back of the dynamic
                                 transaction.
                      [REV END]

status                is the name of an array of 10 halfwords in which
                      TurboIMAGE/XL returns status information about the
                      procedure.  If the procedure executes successfully,
                      the status array contents are as follows:

                      Element    Contents 

                      1          If the procedure succeeds, the return
                                 status is 0.  Table 5-26  describes
                                 the contents of element 1 when the
                                 procedure does not succeed.

                      2-4        Unchanged from previous procedure call
                                 using this array.

                      5-10       Procedure call information.  Refer to
                                 "Library Procedure Error Messages" in
                                 appendix A for a description of this
                                 information.

textlen               is an integer equal to the number of halfwords to
                      be logged from the text parameter, or is a negative
                      integer equal to the number of bytes.  Length can
                      be zero.

Discussion.   

DBXUNDO is called to dynamically roll back a sequence of TurboIMAGE/XL
procedure calls that completed successfully inside a dynamic transaction.
The beginning of such a sequence is designated by a previous call to
DBXBEGIN. DBXUNDO cannot be called to roll back a transaction started by
DBBEGIN or if the database is enabled for AUTODEFER.

Logging and DBRECOV are not needed with dynamic transactions, because the
database can be recovered dynamically.  However, if the calling process
is logging, DBXUNDO causes a record to be written to the log file to
identify the transaction in the event it needs to be recovered.


CAUTION After DBXUNDO is called, the current record pointer, current path, current list, and chronological order prior to the call to DBXBEGIN may not be restored.
[REV BEG] DBXUNDO cannot be called to roll back a transaction started by DBBEGIN.[REV END] DBXUNDO returns an error condition if it is called without a prior matching call to DBXBEGIN. DBXEND is not necessary after DBXUNDO. DBXUNDO rolls back the entire transaction, and then transactions continue according to the logic of the program. In general, DBXUNDO or DBXEND must be the last intrinsic for a dynamic transaction to be executed. It designates the end of that dynamic transaction. Table 5-26. DBXUNDO Return Status Values ---------------------------------------------------------------------------------------------- | | | | | File System, Memory | -215 | XM error nn encountered when rolling out dynamic | | Management, and | | transaction. | | Transaction Management | | | | Failures: | | | | | | | ---------------------------------------------------------------------------------------------- | | | | | Calling Errors: | -11 | Bad database reference. | | | -31 | Bad (unrecognized) DBXUNDO mode n. | | | -140 | Bad baseid list. | | | -151 | Text length greater than 512 bytes. | | | -218 | Output deferred is incompatible with Dynamic | | | -219 | Rollback. | | | | Remote database access is incompatible with Dynamic | | | -223 | Rollback. | | | | Cannot DBXEND or DBXUNDO a transaction which was | | | -237 | not active. | | | -238 | Cannot DBXEND or DBXUNDO a DBBEGIN transaction. | | | -240 | MDBX DBXBEGIN, DBXEND mode mismatch. | | | | MDBX mode mismatch. | | | | | ---------------------------------------------------------------------------------------------- | | | | | Logging System Failures: | -111 | WRITELOG failure. | | | | | ---------------------------------------------------------------------------------------------- | | | | | Exceptional Conditions: | -231 | During DBX recovery, internal procedure failed; | | | -242 | error nn. | | | -332 | Error in TurboGTX file operation. | | | 67 | Error in QLOCK table operation. | | | | DBU disabled; potential damage; only DBCLOSE | | | | allowed. | | | | | ---------------------------------------------------------------------------------------------- Consult appendix A for more information about these conditions.


MPE/iX 5.5 Documentation