Return the type of a transaction referenced by the handle.
MCO_RET mco_trans_type( /*IN*/ mco_trans_h t, /*OUT*/ MCO_TRANS_TYPE * type );
|
t |
The |
|
type |
The address of the MCO_TRANS_TYPE (unsigned integer) to receive the result |
This function returns the type of a transaction referenced by the handle. Upon successful return, type will be one of
MCO_READ_ONLY,MCO_UPDATEorMCO_READ_WRITE.
| MCO_S_OK | The transaction was committed successfully |
| MCO_E_INVALID_HANDLE |
Invalid transaction handle in the trans argument |
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_TYPE ttype;
...
rc = mco_db_open_dev( dbname, simple_get_dictionary(), &dev, 1, &db_params );
if ( MCO_S_OK != rc )
{
rc = mco_db_connect( dbname, &db );
...
rc = mco_trans_start(db, MCO_READ_ONLY, MCO_TRANS_FOREGROUND, &t);
if ( MCO_S_OK == rc )
{
...
rc = mco_trans_type( t, &ttype );
...
}
}
...
}