McoSqlOpenParameters: constructor with arguments

Create an instance of McoSqlOpenParameters and initialize its properties from the arguments passed.

For an overview see page McoSqlOpenParameters

Prototype

     
    McoSqlOpenParameters(char const* name, mco_dictionary_h dictionary, size_t size, 
                size_t pageSize = 128,
                void* mapAddress = MCO_DATABASE_DEFAULT_MAP_ADDRESS,
                size_t maxTransSize = 0,
                int flags = DEFAULT_OPEN_FLAGS,
                char const* savedImage = NULL);
 

Arguments

name The database name
dictionary A handle to the dictionary that was created by the mcocomp schema processor. Normally, this handle is passed in by calling dbname_get_dictionary()
size The total amount of database memory in bytes
pageSize The size of database pages to be managed by the page manager
mapAddress Address for a shared memory database
maxTransSize Maximum transaction size; when 0 the default transaction size is used
flags A bit mask set with values from the enum OpenFlags defined in mcosql.h
savedImage Path and filename of the database image (snapshot) file to load from if specified

Description

This constructor calls setDefaultValues() and sets the indicated properties from the corresponding arguments.

Return Codes

Runtime Exception In case of error a runtime exception will be thrown with the appropriate error message

Examples

 
    {
        MCO_RET rc;
        mco_device_t       dev[4];
        McoSqlEngine engine;
        McoSqlOpenParameters params(dbName, 0, DATABASE_SIZE);
        ...
        engine.open( params );
    }
 

 

     
    {
        int flags = McoSqlOpenParameters::DEFAULT_OPEN_FLAGS;
        flags &= ~(McoSqlOpenParameters::START_MCO_RUNTIME);
        ...
        engine.open( McoSqlOpenParameters(dbName2, ph2commitdb_get_dictionary(),
                DATABASE_SIZE, MEMORY_PAGE_SIZE,
                (void*)0x20000000, 0, flags) );
    }