MCO_RET mco_trans_set_error(mco_trans_h t, MCO_RET errcode);
| t | Transaction handle |
| errcode | Error code to be set |
Sets error state for the transaction. Application can use the function to force the database kernel to interrupt the current transaction. Specifically an external timer can call the function to set the
MCO_E_INTERRUPTEDerror code for the given transaction. For example:
static void timer_handler (mco_db_h db) { mco_trans_h t; if (mco_trans_get_current(db, &t) == MCO_S_OK) { mco_trans_set_error(t, MCO_E_INTERRUPTED); } }
| MCO_S_OK | Error code set successfully |
| MCO_E_INTERRUPTED | Transaction was interrupted by timer, callback or another transaction |