### DbTxn::set_name |

`

###

    #include <db_cxx.h>

    int
    DbTxn::set_name(const char *name);

    int
    DbTxn::get_name(const char **namep);

### Description: DbTxn::set_name

The DbTxn::set_name method associates the specified string with the transaction. The string is returned by DbEnv::txn_stat and displayed by DbEnv::txn_stat_print.

If the database environment has been configured for logging and the Berkeley DB library was configured with --enable-diagnostic, a debugging log record is written including the transaction ID and the name.

The DbTxn::set_name method may be called at any time during the life of the application.

The DbTxn::set_name method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

### Parameters

name
  The name parameter is the string to associate with the transaction.

### Description: DbTxn::get_name

The DbTxn::get_name method returns the string associated with the transaction.

The DbTxn::get_name method may be called at any time during the life of the application.

The DbTxn::get_name method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

### Parameters

namep
  The DbTxn::get_name method returns a reference to the string associated with the transaction in namep.

### Class

DbEnv, DbTxn

### See Also

Transaction Subsystem and Related Methods`

Copyright (c) 1996,2007 Oracle. All rights reserved.