Commit the connection cache (reset) to the database.
MCO_RET mco_disk_reset_connection_cache( /*IN*/ mco_db_h db );
db — The database handle that was established by mco_db_connect().This function commits the connection cache (resets) to the database. The two functions
mco_disk_reset_connection_cache()andmco disk enable connection cache()address a scenario with many connections and long-lasting transactions. In this scenario, the connection cache could cause the page pool to run out of free pages (a new transaction allocates its own connection cache, but long transactions prevent those pages to be release back to the shared page pool). In this case, the connection cache could be turned off or reset often. Under normal circumstances, the application does not need to control the connection cache.
MCO_RET — Returns MCO_S_OK on success, or a non-zero error code on failure.
const char * dbname = "SimpleDb";
int main(int argc, char* argv[])
{
mco_db_h db;
MCO_RET rc;
mco_device_t dev[4];
mco_db_params_t db_params;
...
rc = mco_db_open_dev( dbname, simple_get_dictionary(), dev, 4, &db_params );
if ( MCO_S_OK != rc )
{
rc = mco_db_connect( dbname, &db );
...
rc = mco_disk_reset_connection_cache( db );
...
}
}