Event handling

Your C UDR must perform event handling to ensure recovery from unexpected results, usually a warning or runtime error from the database server. To handle warnings and errors, the C UDR can define callback functions that the DataBlade® API invokes when a particular event occurs.

A C UDR can receive the following events.
Event Description Event type
Database server exception Raised when the database server generates an exception (a warning or an error) MI_Exception
End of statement Raised when the database server completes the execution of the current SQL statement MI_EVENT_END_STMT
End a transaction (commit or rollback) Raised when the database server reaches the end of the current transaction, whether the transaction contains one or many SQL statements MI_EVENT_END_XACT
End of session Raised when the database server reaches the end of the current session MI_EVENT_END_SESSION

The UDR can register callback functions for any of these events. For more information about how to handle database server exceptions, see Database server exceptions. For information about how to handle state-transition events (such as end of statement, end of transaction, and end of session), see State-transition events.