9-54 IBM Informix OnLine Database Server Administrator’s Guide
Determining Database Consistency
Steps 3 and 4: Decide If Correction Is Needed
If an inconsistent transaction creates an inconsistent database, three options
are available to you:
Leave the networked database in its inconsistent state.
Remove the effects of the transaction wherever it was committed,
thereby rolling back the entire transaction.
Reapply the effects of the transaction wherever it was rolled back,
thereby committing the transaction.
You might decide to leave the database in its inconsistent state if the trans-
action does not significantly affect database data. This is the situation if the
application can continue as it is and you decide that the price (in time and
effort) of returning the database to a consistent state by either removing the
effects or reapplying the transaction is too high.
Youdo not have to reach this decision immediately.You can use the methods
described in the following paragraphs to determine what data the trans-
action was updating and which records are affected.
As you make your decision, consider that there is no automatic process or
utility that can perform a rollback of a committed transaction or that can
commit part of a transaction that has been rolled back. The following
paragraphs describe how to look through the OnLine message log and the
logical log to locate affected records. Without detailed knowledge of the
application, messages are not enough to determine what has happened. It
remains your responsibility, based on your knowledge of your application
and your system, to determine whether to roll back or to commit the trans-
action.It is also your responsibility to program the compensating transaction
that will perform the rollback or the commit.
Step 5: Use Logical Log Records
A participant OnLine logical log is the starting point for your information
search.The transaction that rolled back has a HEURTX record associated with
it. The HEURTX record contains the local transaction identification number
(local xid). Use the local xid to locate all associated log records that rolled
backas part of this piece of work. Use these records and your knowledge of
the application to program a compensating transaction that will undo the
effects of the rollback.