Explicitly flush the file system buffers.
MCO_RET mco_disk_flush( /*IN*/ mco_db_h db );
| db | The database handle that was established by mco_db_connect() |
This function allows applications to explicitly flush the file system buffers; it is most often used in conjunction with the
MCO_COMMIT_NOSYNCTransaction Commit policy.
| MCO_S_OK | File system buffers successfully flushed to disk. (No flush actually occurs if called for a in-memory database.) |
| MCO_E_DISK_FLUSH |
Error flushing buffers to disk |
| MCO_E_DISK_OPERATION_NOT_ALLOWED | An attempt was made to flush to disk with an active transaction open. This function must be called when the current connection has no active transactions |
Application snippet:
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_flush( db );
...
}
}