1<!--$Id: txn_set_name.so,v 10.2 2005/05/17 04:01:01 mjc Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB: DbTxn::set_name</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td> 13<b>DbTxn::set_name</b> 14</td> 15<td align=right> 16<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a> 17<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td> 18</tr></table> 19<hr size=1 noshade> 20<tt> 21<b><pre> 22#include <db_cxx.h> 23<p> 24int 25DbTxn::set_name(const char *name); 26<p> 27int 28DbTxn::get_name(const char **namep); 29</pre></b> 30<hr size=1 noshade> 31<b>Description: DbTxn::set_name</b> 32<p>The DbTxn::set_name method associates the specified string with the 33transaction. The string is returned by <a href="../api_cxx/txn_stat.html">DbEnv::txn_stat</a> and displayed 34by <a href="../api_cxx/txn_stat.html">DbEnv::txn_stat_print</a>.</p> 35<p>If the database environment has been configured for logging and the 36Berkeley DB library was configured with 37<a href="../ref/build_unix/conf.html#--enable-diagnostic">--enable-diagnostic</a>, a debugging log record is written including the 38transaction ID and the name.</p> 39<p>The DbTxn::set_name method may be called at any time during the life of the 40application.</p> 41<p>The DbTxn::set_name method 42either returns a non-zero error value 43or throws an exception that encapsulates a non-zero error value on 44failure, and returns 0 on success. 45</p> 46<b>Parameters</b> <br> 47 <b>name</b><ul compact><li>The <b>name</b> parameter is the string to associate with the 48transaction.</ul> 49<br> 50<hr size=1 noshade> 51<b>Description: DbTxn::get_name</b> 52<p>The DbTxn::get_name method returns the string associated with the transaction.</p> 53<p>The DbTxn::get_name method may be called at any time during the life of the 54application.</p> 55<p>The DbTxn::get_name method 56either returns a non-zero error value 57or throws an exception that encapsulates a non-zero error value on 58failure, and returns 0 on success. 59</p> 60<b>Parameters</b> <br> 61 <b>namep</b><ul compact><li>The DbTxn::get_name method returns a reference to the 62string associated with the transaction in <b>namep</b>.</ul> 63<br> 64<hr size=1 noshade> 65<br><b>Class</b> 66<a href="../api_cxx/env_class.html">DbEnv</a>, <a href="../api_cxx/txn_class.html">DbTxn</a> 67<br><b>See Also</b> 68<a href="../api_cxx/txn_list.html">Transaction Subsystem and Related Methods</a> 69</tt> 70<table width="100%"><tr><td><br></td><td align=right> 71<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a> 72</td></tr></table> 73<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 74</body> 75</html> 76