1
<!--$Id: txn_stat.so,v 10.29 2001/04/03 16:27:56 bostic Exp $-->
2
<!--Copyright 1997-2001 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
6
<title>Berkeley DB: DbEnv::txn_stat</title>
7
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
11
<a name="2"><!--meow--></a>
12
<table width="100%"><tr valign=top>
14
<h1>DbEnv::txn_stat</h1>
17
<a href="../api_cxx/cxx_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
22
#include <db_cxx.h>
25
DbEnv::txn_stat(DB_TXN_STAT **statp);
28
<p>The DbEnv::txn_stat method
29
creates a statistical structure and copies a pointer to it into a
30
user-specified memory location.
31
<p>Statistical structures are created in allocated memory. If application-specific allocation
32
routines have been declared (see <a href="../api_cxx/env_set_alloc.html">DbEnv::set_alloc</a> for more
33
information), they are used to allocate the memory; otherwise, the
34
library function <b>malloc</b>(3) is used. The caller is
35
responsible for deallocating the memory. To deallocate the memory, free
36
the memory reference; references inside the returned memory need not be
38
<p>The transaction region statistics are stored in a structure of type
39
DB_TXN_STAT. The following DB_TXN_STAT fields will be filled in:
41
<dt><a href="../api_cxx/lsn_class.html">DbLsn</a> st_last_ckp;<dd>The LSN of the last checkpoint.
42
<dt><a href="../api_cxx/lsn_class.html">DbLsn</a> st_pending_ckp;<dd>The LSN of any checkpoint that is currently in progress. If
43
<b>st_pending_ckp</b> is the same as <b>st_last_ckp</b> there
44
is no checkpoint in progress.
45
<dt>time_t st_time_ckp;<dd>The time the last completed checkpoint finished (as the number of seconds
46
since the Epoch, returned by the IEEE/ANSI Std 1003.1 (POSIX) <b>time</b> interface).
47
<dt>u_int32_t st_last_txnid;<dd>The last transaction ID allocated.
48
<dt>u_int32_t st_maxtxns;<dd>The maximum number of active transactions possible.
49
<dt>u_int32_t st_nactive;<dd>The number of transactions that are currently active.
50
<dt>u_int32_t st_maxnactive;<dd>The maximum number of active transactions at any one time.
51
<dt>u_int32_t st_nbegins;<dd>The number of transactions that have begun.
52
<dt>u_int32_t st_naborts;<dd>The number of transactions that have aborted.
53
<dt>u_int32_t st_ncommits;<dd>The number of transactions that have committed.
54
<dt>u_int32_t st_regsize;<dd>The size of the region.
55
<dt>u_int32_t st_region_wait;<dd>The number of times that a thread of control was forced to wait before
56
obtaining the region lock.
57
<dt>u_int32_t st_region_nowait;<dd>The number of times that a thread of control was able to obtain
58
the region lock without waiting.
59
<dt>DB_TXN_ACTIVE * st_txnarray;<dd>A pointer to an array of <b>st_nactive</b> DB_TXN_ACTIVE structures,
60
describing the currently active transactions. The following fields of
61
the DB_TXN_ACTIVE structure will be filled in:
63
<p><dt>u_int32_t txnid;<dd>The transaction ID of the transaction.
64
<dt>u_int32_t parentid;<dd>The transaction ID of the parent transaction (or 0, if no parent).
65
<dt><a href="../api_cxx/lsn_class.html">DbLsn</a> lsn;<dd>The log sequence number of the transaction-begin record.
68
<p>The DbEnv::txn_stat method either returns a non-zero error value or throws an exception that
69
encapsulates a non-zero error value on failure, and returns 0 on success.
71
<p>The DbEnv::txn_stat method may fail and throw an exception or return a non-zero error for errors specified for other Berkeley DB and C library or system methods.
72
If a catastrophic error has occurred, the DbEnv::txn_stat method may fail and either
73
return <a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a> or throw an exception encapsulating
74
<a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a>, in which case all subsequent Berkeley DB calls will fail
77
<a href="../api_cxx/dbenv_class.html">DbEnv</a>, <a href="../api_cxx/txn_class.html">DbTxn</a>
79
<a href="../api_cxx/env_set_tx_max.html">DbEnv::set_tx_max</a>,
80
<a href="../api_cxx/env_set_tx_recover.html">DbEnv::set_tx_recover</a>,
81
<a href="../api_cxx/env_set_tx_timestamp.html">DbEnv::set_tx_timestamp</a>,
82
<a href="../api_cxx/txn_abort.html">DbTxn::abort</a>,
83
<a href="../api_cxx/txn_begin.html">DbEnv::txn_begin</a>,
84
<a href="../api_cxx/txn_checkpoint.html">DbEnv::txn_checkpoint</a>,
85
<a href="../api_cxx/txn_commit.html">DbTxn::commit</a>,
86
<a href="../api_cxx/txn_discard.html">DbTxn::discard</a>,
87
<a href="../api_cxx/txn_id.html">DbTxn::id</a>,
88
<a href="../api_cxx/txn_prepare.html">DbTxn::prepare</a>,
89
<a href="../api_cxx/txn_recover.html">DbEnv::txn_recover</a>,
91
<a href="../api_cxx/txn_stat.html">DbEnv::txn_stat</a>.
93
<table width="100%"><tr><td><br></td><td align=right>
94
<a href="../api_cxx/cxx_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
96
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>