Register a real-time transaction callback function for deadline monitoring.
typedef MCO_RET (*mco_trans_rt_callback_t)(mco_trans_h t);
MCO_RET mco_trans_rt_register_callback(
/*IN*/ mco_db_h db,
/*IN*/ mco_trans_rt_callback_t callback
);
db
callback
mco_trans_rt_callback_t. May be NULL to unregister a previously set callback.This function registers a callback that is invoked by the eXtremeDB/rt kernel at predefined cancellation points during real-time transaction execution. The callback allows the application to check whether the transaction has exceeded its deadline and decide whether to continue or abort.
The callback is registered per database connection. If your application uses multiple connections for real-time transactions, you must register the callback separately for each one.
The callback function receives the current transaction handle and must return:
MCO_S_OK— the transaction is still within its deadline and may continue,MCO_E_INTERRUPTED— the transaction has exceeded its deadline; the kernel will mark the transaction as interrupted, and the application should roll it back.Once a transaction is marked as interrupted (due to
MCO_E_INTERRUPTED), all subsequent database operations within that transaction will also returnMCO_E_INTERRUPTEDuntil the transaction is rolled back.
MCO_S_OK
MCO_E_INTERRUPTED