Understanding state-transition events
State-transition events occur when the database server changes its processing state. The DataBlade® API represents a state transition as one of the enumerated values of the MI_TRANSITION_TYPE data type.
The following table shows the transitions in the server-processing
state and the corresponding MI_TRANSITION_TYPE values.
State-transition type | Description |
---|---|
MI_BEGIN | The database server is beginning a new transaction. |
MI_NORMAL_END | The database server just completed the current event successfully. |
MI_ABORT_END | The database server just rolled back the current event. (The statement failed, or the transaction was aborted or rolled back.) |
The milib.h header file defines the MI_TRANSITION_TYPE data type and its state-transition values.
The following table shows the state-transition types and the state-transition
events that they can cause.
State-transition type | Event in client LIBMI application | Event in C UDR |
---|---|---|
Begin transaction or savepoint (MI_BEGIN) | MI_Xact_State_Change | None |
Event end: commit (MI_NORMAL_END) | MI_Xact_State_Change | MI_EVENT_SAVEPOINT |
Event end: rolled back (MI_ABORT_END) | MI_Xact_State_Change | MI_EVENT_SAVEPOINT |