Start a real-time transaction.
typedef struct mco_trans_rt_params_t_
{
mco_interval_t deadline;
} mco_trans_rt_params_t;
// static initializer for mco_trans_rt_params_t
#define MCO_TRANS_DEFAULT_PARAMS {MCO_MAX_DEADLINE}
MCO_RET mco_trans_rt_start(mco_db_h db, MCO_TRANS_TYPE type, MCO_TRANS_PRIORITY pri, mco_trans_rt_params_t const* params, /*OUT*/mco_trans_h* p_trans);| db | The database handle that was established by mco_db_connect() |
| type | value from the enum MCO_TRANS_TYPE |
| pri | value from the enum MCO_TRANS_PRIORITY |
| params | The address of parameters (deadline) |
|
p_trans |
The address of a mco_trans_h to receive the transaction handle |
Start a real-time transaction with a deadline set by
params->deadline(MCO_MAX_DEADLINEfor "usual" non-real-time transactions).
mco_trans_rt_start()won't allow to a real-time transaction with a finite deadline to start unless the rollback buffer is enabled. It is possible to disable the rollback buffer and revert to the classic implementation for running non-real-time transactions (with infinite deadlines).
| MCO_S_OK | Transaction was started successfully |
| MCO_E_INTERRUPTED | Transaction was interrupted by timer, callback or another transaction |
|
MCO_ERR_TRN |
A database transaction error occurred. |
|
MCO_E_INCOMPATIBLE_ROLLBACK |
An attempt to start a real-time transaction with a finite deadline without the rollback buffer enabled. |