9-38 IBM Informix OnLine Database Server Administrator’s Guide
Heuristic Rollback
The next event in the scenario happens at the coordinator OnLine. The
coordinator issues second-phase instructions either to roll back the trans-
action or to commit the transaction.
If the coordinator decision is to roll back the global transaction, a database
server process at the participant OnLine writes an ENDTRANS record in the
logical log and the transaction associated with this piece of work is closed.
Logical log files containing records associated with this transaction are no
longer prevented from being freed if all other conditions are met. In this case,
no error is returned and the heuristic decision is transparent to users.
If the coordinator decision is to commit the global transaction, a database
server process at the participant OnLine where the heuristic rollback
occurred returns to the coordinator error message -699:
-699 Transaction heuristically rolled back.
This error message is not returned to the application at this point; it is an
internal notification to the coordinator. The coordinator continues to wait
until all participants have responded to the commit instruction. The coordi-
nator does not make a determination of database consistency until all
participants have reported. The scenario continues in the paragraphs that
follow.
The coordinator gathers all responses from participants. If every participant
reports a heuristic rollback, the following events occur as a consequence:
1. The coordinator writes the following message to its own OnLine
message log:
Transaction heuristically rolled back.
2. The coordinator sends a message to all participants to end the
transaction.
3. Each participant writes an ENDTRANS record in its logical log buffer.
(The transaction entry is removed from the shared-memory trans-
action table.)
4. The coordinator writes an ENDTRANS record in its logical log buffer.
(The transaction entry is removed from the shared-memory trans-
action table.)
5. The coordinator returns error -699 to the application:
-699 Transaction heuristically rolled back.
In this situation, all databases remain consistent.