
Product Environment 9-27
Two-Phase Commit and Automatic Recovery
If the participant does not receive contact from the coordinator by the time
specified as TXTIMEOUT(referto page 9-57), thetbinit process at thepartic-
ipant OnLine reads the value of SQLEXEC to fork a new database server
process. (If SQLEXEC is not set, tbinit uses the pathname $INFOR-
MIXDIR
/lib/sqlturbo.The database server processisowned by theuser who
started tbinit, either informix or root.)
This server process acts as the new participant. It attempts to determine the
status ofthe transaction. To do this, it forksa new database server process at
thecoordinatingOnLine.(Todothis,ansqlexecdprocessmustbe runningat
the coordinator OnLine.)
A message is sent from the database server at the participant OnLine to the
database server at the coordinator OnLine. If the state of the transaction is
“unknown,” meaning no entry exists in the coordinator OnLine shared-
memory transaction table, the participant assumes that the transaction was
rolledback. (Thissituationisoneexampleofwhatismeant bypresumed-abort
optimization in the two-phase commit protocol.)
The database server process atthe participant OnLine rolls back the piece of
work, frees shared-memory resources, and removes the transaction entry
fromitsshared-memorytransactiontable. When thedatabaseserver process
exits, it also removes the database server process at the coordinator OnLine.
Iftheparticipantisunabletocontactthecoordinatororifexecutionerrorsare
detected, messages are recorded in the OnLine message log. The transaction
renewsits waitingforanotherperiodoftimespecifiedbyTXTIMEOUT. When
the specified time has again elapsed, tbinit spawns another database server
process and the procedure repeats.
Komentáře k této Příručce