The mi_transition_type() function
The mi_transition_type() accessor function obtains the type of state transition from a transition descriptor.
Syntax
MI_TRANSITION_TYPE mi_transition_type(trans_desc)
MI_TRANSITION_DESC *trans_desc;
- trans_desc
- A pointer to the transition descriptor that was passed to the callback.
Valid in client LIBMI application? | Valid in user-defined routine? |
---|---|
Yes | Yes |
Usage
The mi_transition_type() function
obtains the transition type from the transition descriptor that trans_desc references.
The DataBlade®
API provides
the following transition-type constants.
- MI_BEGIN
- The database server begins a new transaction.
- MI_NORMAL_END
- The database server ended the current transaction by committing the transaction.
- MI_ABORT_END
- The database server ended the current transaction by rolling back (aborting) the transaction.
This function is useful within a state-transition or all-events callback to determine the current transition type.
Server only: In a C UDR routine, the following
state-transition events occur at a change in transition type:
- MI_EVENT_SAVEPOINT
- MI_EVENT_COMMIT_ABORT
- MI_EVENT_POST_XACT
- MI_EVENT_END_STMT
- MI_EVENT_END_XACT
- MI_EVENT_END_SESSION
These events occur only for the MI_NORMAL_END and MI_ABORT_END state transitions.
Client only: In
a client LIBMI application, the state-transition event MI_Xact_State_Change
occurs at a change in transition type. This event occurs for all state
transitions: MI_BEGIN, MI_NORMAL_END, and MI_ABORT_END.
For a description of the transition descriptor, see the Informix® DataBlade® API Programmer's Guide.
Return values
- MI_BEGIN
- The database server just began a new transaction.
- MI_NORMAL_END
- The database server just committed the transaction.
- MI_ABORT_END
- The database server just rolled back (aborted) the transaction.
- MI_ERROR
- The function was not successful.