This chapter explains some advanced concepts that the LIXA system administrator should know to solve some complex issues the XA technology could generate. LIXA technology provide two type of recovery:
Automatic Recovery: it happens silently and rolls back or commits the transactions that crashed before a consistent point had been reached
Manual Recovery: it is invoked by lixar utility to solve the transactions that cannot be automatically recovered
lixar utility was designed to operate with statically
defined XA Resource Managers described in
lixac_conf.xml
configuration file.
XTA, explained in
Chapter 8, Developing Application Programs using XTA (XA Transaction API) interface,
introduces dynamically defined XA Resource Managers that can't be managed
by lixar utility if they are not defined in
lixac_conf.xml
too
If your environment is configured and runs as designed, when an Application Program fails an automatic recovery operation fix the problem as soon as possible. Below there is a first trivial scenarios:
the Application Program crashes before it reaches the
xa_prepare()
function
(called by tx_commit()
)
the Resource Managers autonoumosly roll back the work in progress and the environment is cleaned up
the distributed transaction started but it did not initiated the two phase commit protocol: there is no relevant difference between this scenario and a single Resource Manager (one phase commit) scenario. The LIXA Transaction Manager does not manage a recovery phase.
The following scenario is slightly different:
the Application Program crashes after it has passed the
xa_prepare()
function but before it
reaches the xa_commit()
function
the Resource Managers keep the prepared transaction “in flight” until the Transaction Manager decides the proper recovery action
an “equivalent” Application Program starts
and activates
the LIXA Transaction Manager with tx_open()
the LIXA Transaction Manager discovers there is a prepared transaction and establishes that it must commit the transaction
the second Application Program implicitly and inconsciously started the recovery process of a previously crashed Application Program
The above pattern is the result of the LIXA design: the Transaction
Manager is not an active component, but it's a passive one and
is embedded in the Application Program when it links the
lixac
library
and activates it with the
tx_open()
function.
Depending on the crash time: slightly before the
prepare phase,
in the middle of the prepare phase,
after the completion of the prepare phase,
the LIXA Transaction Manager chooses a different recovery
operation between
xa_commit()
and
xa_rollback()
.