Debian Codegraph @

lang/tcl/docs/txn.html

raw
1 <!--Copyright (c) 1999, 2013 Oracle and/or its affiliates. All rights reserved.-->
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5 <meta name="GENERATOR" content="Mozilla/4.75 [en] (X11; U; Linux 2.2.16-22 i686) [Netscape]">
6 </head>
7 <body>
8
9 <h2>
10 <a NAME="Transaction Commands"></a>Transaction Commands</h2>
11 Transactions are used in a manner similar to the other subsystems.&nbsp;
12 We create a handle to the transaction and&nbsp; then use it for a variety
13 of operations.&nbsp; Some of the transaction commands use the environment
14 instead.&nbsp; Those are presented first.&nbsp; The transaction command
15 handle returned is the handle used by the various commands that can be
16 transaction protected, such as <a href="../../docs/api_tcl/db_cursor.html">cursors</a>.
17 <br>
18 <hr WIDTH="100%">
19 <p><b>> &lt;env> txn_checkpoint [-kbyte <i>kb</i>] [-min <i>min</i>]</b>
20 <p>This command causes a checkpoint of the transaction region.&nbsp; It
21 is a direct translation of the <a href="../../docs/api_c/txn_checkpoint.html">txn_checkpoint
22 </a>function.&nbsp;
23 It returns either a 0 (for success), a DB error message or it throws a
24 Tcl error with a system message.&nbsp; The arguments are:
25 <ul>
26 <li>
27 <b>-force</b>causes the checkpoint to occur regardless of inactivity
28
29 <li>
30 <b>-kbyte</b>causes the checkpoint to occur only if <b><i>kb</i></b> kilobytes
31 of log data has been written since the last checkpoint
32
33 <li>
34 <b>-min</b> causes the checkpoint to occur only if <b><i>min</i></b> minutes
35 have passed since the last checkpoint
36 </ul>
37
38 <hr WIDTH="100%">
39 <br><b>> &lt;env> txn_stat</b>
40 <p>This command returns transaction statistics.&nbsp; It is a direct translation
41 of the <a href="../../docs/api_c/txn_stat.html">txn_stat</a> function.&nbsp;
42 It will return a list of name/value pairs that correspond to the DB_TXN_STAT
43 structure.
44 <hr WIDTH="100%">
45 <br><b>> &lt;env> txn_id_set&nbsp;</b><i> current max</i>
46 <p>This is a diagnostic command that sets the next transaction id to be
47 allocated and the maximum transaction
48 <br>id, which is the point at which the relcaimation algorthm is triggered.
49 <hr WIDTH="100%">
50 <br><b>>&nbsp; &lt;txn> id</b>
51 <p>This command returns the transaction id.&nbsp; It is a direct call to
52 the <a href="../../docs/api_c/txn_id.html">txn_id</a> function.&nbsp; The
53 typical use of this identifier is as the <b><i>locker</i></b> value for
54 the <a href="lock.html">lock_get</a> and <a href="lock.html">lock_vec</a>
55 calls.
56 <hr WIDTH="100%">
57 <br><b>> &lt;txn> prepare</b>
58 <p>This command initiates a two-phase commit.&nbsp; It is a direct call
59 to the <a href="../../docs/api_c/txn_prepare.html">txn_prepare</a> function.&nbsp;
60 It returns either a 0 (for success), a DB error message or it throws a
61 Tcl error with a system message.
62 <hr WIDTH="100%"><a NAME="> <env> lock_vec"></a><b>> &lt;env> txn_timeout
63 <i>timeout</i></b>
64 <p>This command sets thetransaction timeout for transactions started in
65 the future in this environment.&nbsp; The timeout is in micorseconds.
66 <br>&nbsp;
67 <br>&nbsp;
68 </body>
69 </html>