# mco_trans_set_default_isolation_level

> Set the default isolation level for the current connection.

### Prototype

        MCO_TRANS_ISOLATION_LEVEL mco_trans_set_default_isolation_level( /*IN*/ mco_db_h db,
                                              /*IN*/ MCO_TRANS_ISOLATION_LEVEL level );

### Arguments

db | The database handle that was established by `mco_db_connect()`
level | The new isolation level to set for the current connection

### Description

> This function sets the default isolation level for the MVCC Transaction Manager in the current connection.

### Return Codes

MCO_TRANS_ISOLATION_LEVEL | Previous isolation level

### Example

        Application snippet:

        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;
            mco_trans_h t;
            MCO_TRANS_ISOLATION_LEVEL level = MCO_SERIALIZABLE;

            ...
            rc = mco_db_open_dev( dbname, simple_get_dictionary(), &dev, 1, &db_params );
            if ( MCO_S_OK != rc )
            {
                rc = mco_db_connect(  dbname, &db );
                ...
                level = mco_trans_set_default_isolation_level( db, level );
                if ( MCO_REPEATABLE_READ == level )
                    printf("\nThe previous Isolation level was Read_Repeatable." );
                ...
            }
            ...
        }

### Files

Header file:
mco.h
Source file:
mcoconn.c
Library:
libmcolib.a