Remove a shared memory segment associated with a database.
MCO_RET mco_db_kill(/*IN*/ const char *dbname);
dbname
mco_db_open().This function removes the shared memory segment allocated by the runtime for the database identified by the
dbname. It also removesdbnamefrom the registry. Use this function to clean up orphaned shared memory allocated by the runtime when necessary. The function does not do any harm if the specified shared memory segment and registry entry do not exist.Attention! If the data segment is "killed" during a database session, the results are unpredictable, but always disastrous.
MCO_S_OK
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;
...
if ((rc = mco_runtime_start()) != MCO_S_OK)
exit(-1);
rc = mco_db_kill("SimpleDb");
if (MCO_S_OK != rc)
{
rc = mco_db_open_dev(dbname, simpledb_get_dictionary(), &dev, 1, &db_params);
...
}
}