~ubuntu-branches/ubuntu/edgy/rpm/edgy

« back to all changes in this revision

Viewing changes to db/docs/api_cxx/txn_stat.html

  • Committer: Bazaar Package Importer
  • Author(s): Joey Hess
  • Date: 2002-01-22 20:56:57 UTC
  • Revision ID: james.westby@ubuntu.com-20020122205657-l74j50mr9z8ofcl5
Tags: upstream-4.0.3
ImportĀ upstreamĀ versionĀ 4.0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.-->
 
4
<html>
 
5
<head>
 
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++">
 
9
</head>
 
10
<body bgcolor=white>
 
11
<a name="2"><!--meow--></a>
 
12
<table width="100%"><tr valign=top>
 
13
<td>
 
14
<h1>DbEnv::txn_stat</h1>
 
15
</td>
 
16
<td align=right>
 
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>
 
18
</td></tr></table>
 
19
<hr size=1 noshade>
 
20
<tt>
 
21
<h3><pre>
 
22
#include &lt;db_cxx.h&gt;
 
23
<p>
 
24
int
 
25
DbEnv::txn_stat(DB_TXN_STAT **statp);
 
26
</pre></h3>
 
27
<h1>Description</h1>
 
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
 
37
individually freed.
 
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:
 
40
<p><dl compact>
 
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:
 
62
<p><dl compact>
 
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.
 
66
</dl>
 
67
</dl>
 
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.
 
70
<h1>Errors</h1>
 
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
 
75
in the same way.
 
76
<h1>Class</h1>
 
77
<a href="../api_cxx/dbenv_class.html">DbEnv</a>, <a href="../api_cxx/txn_class.html">DbTxn</a>
 
78
<h1>See Also</h1>
 
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>,
 
90
and
 
91
<a href="../api_cxx/txn_stat.html">DbEnv::txn_stat</a>.
 
92
</tt>
 
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>
 
95
</td></tr></table>
 
96
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>
 
97
</body>
 
98
</html>