Exceptions and events
This section describes exceptions and events, and explains how to handle them in DataBlade API modules.
- DataBlade API event types
For a DataBlade API module, an event is a communication from HCL Informix® software that indicates the existence of some predefined condition, usually the occurrence of an exception (warning or error). The DataBlade API represents an event as one of the enumerated values of the MI_EVENT_TYPE data type. - Event-handling mechanisms
An event-handling mechanism provides a way for one DataBlade API module to inform another module (or another part of the same module) that an event has occurred during execution of a function. - Callback functions
To catch or handle an event, you create a C function called a callback function. In your DataBlade API module, you can register callback functions to handle recovery from events. The DataBlade API invokes a registered (and enabled) callback when the event associated with the callback occurs. - Database server exceptions
When the database server or a UDR raises a database server exception, the DataBlade API invokes any callbacks that are registered for the exception. - State-transition events
When the database server raises a state-transition event, the database server invokes any callbacks registered for the state transition. This section provides information about state-transition handling in DataBlade API modules, including an explanation of state-transition events and a description of how to handle a state-transition event in a C UDR and a client LIBMI application. - Client LIBMI errors
The DataBlade API throws the MI_Client_Library_Error event to indicate an error in the client LIBMI library.
Parent topic: Database access