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: DB_TXN->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>DB_TXN->set_name</b> 14</td> 15<td align=right> 16<a href="../api_c/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.h> 23<p> 24int 25DB_TXN->set_name(DB_TXN *txn, const char *name); 26<p> 27int 28DB_TXN->get_name(DB_TXN *txn, const char **namep); 29</pre></b> 30<hr size=1 noshade> 31<b>Description: DB_TXN->set_name</b> 32<p>The DB_TXN->set_name method associates the specified string with the 33transaction. The string is returned by <a href="../api_c/txn_stat.html">DB_ENV->txn_stat</a> and displayed 34by <a href="../api_c/txn_stat.html">DB_ENV->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 DB_TXN->set_name method may be called at any time during the life of the 40application.</p> 41<p>The DB_TXN->set_name method 42returns a non-zero error value on failure 43and 0 on success. 44</p> 45<b>Parameters</b> <br> 46 <b>name</b><ul compact><li>The <b>name</b> parameter is the string to associate with the 47transaction.</ul> 48<br> 49<hr size=1 noshade> 50<b>Description: DB_TXN->get_name</b> 51<p>The DB_TXN->get_name method returns the string associated with the transaction.</p> 52<p>The DB_TXN->get_name method may be called at any time during the life of the 53application.</p> 54<p>The DB_TXN->get_name method 55returns a non-zero error value on failure 56and 0 on success. 57</p> 58<b>Parameters</b> <br> 59 <b>namep</b><ul compact><li>The DB_TXN->get_name method returns a reference to the 60string associated with the transaction in <b>namep</b>.</ul> 61<br> 62<hr size=1 noshade> 63<br><b>Class</b> 64<a href="../api_c/env_class.html">DB_ENV</a>, <a href="../api_c/txn_class.html">DB_TXN</a> 65<br><b>See Also</b> 66<a href="../api_c/txn_list.html">Transaction Subsystem and Related Methods</a> 67</tt> 68<table width="100%"><tr><td><br></td><td align=right> 69<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a> 70</td></tr></table> 71<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 72</body> 73</html> 74