State and Step
Characteristics of State and Step are:
- There must be at least two
states of type
START
andSTOP
.When a new message arrives,
START
state is entered and a unique XID is generated for the transaction.If any error happens, then
STOP
state is entered to do rollbacks. - Every state is configured with an Action TPS and a Rollback TPS.
- A synchronous state can perform all its work in the action TPS.
- An asynchronous state requires
an associated thread’s help. When the asynchronous state is entered, the DTC thread
sends a
DATA
message to the associated thread. It gets necessary information from theREPLY
message sent back by the associated thread. - The DTC state machine runs in
the outbound side
WriteMsg
function. This ispd_fn_write_msg
in the protocol driver. For example,after OB Post-TPS Queue
. - Step increases by one for
every state transition. When a state is entered, the
DATA
message is automatically stored in the staging database and then the Action TPS is called.