Set the maximum number of “unused versions” retained by the MVCC Transaction Manager.
int mco_trans_set_unused_versions_limit( /*IN*/ mco_db_h db,
/*IN*/ int max_unused_versions );
| db | The database handle that was established by mco_db_connect() |
|
max_unused_versions |
The new limit to set for unused versions in the current connection |
This function sets the maximum number of “unused versions” retained by the MVCC Transaction Manager. Once the limit is reached, the Transaction Manager turns on “exclusive mode” and removes all unused versions (cleans up indexes).
| Integer | Previous limit |
Application snippet:
const char * dbname = "SimpleDb";
int main(int argc, char* argv[])
{
mco_db_h db;
MCO_RET rc;
mco_device_t dev;
mco_db_params_t db_params;
mco_trans_h t;
int limit = 100;
...
rc = mco_db_open_dev( dbname, simple_get_dictionary(), &dev, 1, &db_params );
if ( MCO_S_OK != rc )
{
rc = mco_db_connect( dbname, &db );
...
limit = mco_trans_set_unused_versions_limit( db, limit);
printf("\nThe previous Unused Versions limit was %d.", limit );
}
...
}