mco_disk_enable_connection_cache

Enable or disable the connection cache.

Prototype

    mco_bool mco_disk_enable_connection_cache(/*IN*/ mco_db_h db, /*IN*/ mco_bool enable);

Arguments

Description

The runtime “pins” a predefined number of pages from the page pool for each connection. This is referred to as a “connection cache”. When a transaction loads pages into the page pool, and the total number of pages loaded from the media is less than the size of the connection cache, the runtime makes sure that these pages stay in the cache until the transaction is committed, or the database connection is broken. By default the size of the connection cache is set to four pages. It is not possible to modify the connection cache size (nor does it make sense to).

The connection cache is enabled by default. This API enables or disables the connection cache and returns the current state of the connection cache.

Return Codes

Example

    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;
        mco_bool enabled = MCO_NO;

        ...
        rc = mco_db_open_dev( dbname, simple_get_dictionary(), dev, 4, &db_params );

        if ( MCO_S_OK != rc )
        {
            rc = mco_db_connect( dbname, &db );
            ...
            enabled = mco_disk_enable_connection_cache( db, enabled );

            ...
        }
    }

Files

Header file:
mco.h
Source file:
mcodisk.c
Library:
libmcovtdsk.a
Header file:
mco.h
Source file:
mcovtmem.c
Library:
libmcovtmem.a