• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt/router/db-4.8.30/docs/api_reference/TCL/
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml">
4  <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6    <title>env txn</title>
7    <link rel="stylesheet" href="apiReference.css" type="text/css" />
8    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9    <link rel="start" href="index.html" title="Berkeley DB TCL API Reference" />
10    <link rel="up" href="tclapi.html" title="Chapter��1.�� Berkeley DB Tcl APIs" />
11    <link rel="prev" href="env_remove.html" title="berkdb envremove" />
12    <link rel="next" href="txn_abort.html" title="txn abort" />
13  </head>
14  <body>
15    <div class="navheader">
16      <table width="100%" summary="Navigation header">
17        <tr>
18          <th colspan="3" align="center"><span class="emphasis"><em>env</em></span> txn</th>
19        </tr>
20        <tr>
21          <td width="20%" align="left"><a accesskey="p" href="env_remove.html">Prev</a>��</td>
22          <th width="60%" align="center">Chapter��1.��
23                Berkeley DB Tcl APIs
24        </th>
25          <td width="20%" align="right">��<a accesskey="n" href="txn_abort.html">Next</a></td>
26        </tr>
27      </table>
28      <hr />
29    </div>
30    <div class="sect1" lang="en" xml:lang="en">
31      <div class="titlepage">
32        <div>
33          <div>
34            <h2 class="title" style="clear: both"><a id="txn"></a><span class="emphasis"><em>env</em></span> txn</h2>
35          </div>
36        </div>
37      </div>
38      <pre class="programlisting">env txn
39	[-nosync]
40	[-nowait]
41	[-parent txnid]
42	[-sync]  </pre>
43      <p>
44         The <span class="emphasis"><em>env</em></span> <span class="bold"><strong>txn</strong></span>
45         command begins a transaction.  The returned transaction handle is
46         bound to a Tcl command of the form <span class="bold"><strong>env.txnX</strong></span>, where X is an integer starting at 0
47         (for example, env0.txn0 and env0.txn1). It is through this Tcl command
48         that the script accesses the transaction methods.
49    </p>
50      <p>
51        The options are as follows:
52    </p>
53      <div class="itemizedlist">
54        <ul type="disc">
55          <li>
56            <p>
57                 <span class="bold"><strong>-nosync</strong></span> 
58            </p>
59            <p>
60                 Do not synchronously flush the log when this transaction commits or
61                 prepares. This means the transaction will exhibit the ACI (atomicity,
62                 consistency, and isolation) properties, but not D (durability); that
63                 is, database integrity will be maintained, but it is possible that
64                 this transaction may be undone during recovery instead of being
65                 redone.     
66             </p>
67            <p>
68                 This behavior may be set for an entire Berkeley DB environment as part
69                 of the <span class="bold"><strong>berkdb env</strong></span> call.
70            </p>
71          </li>
72          <li>
73            <p>
74                  <span class="bold"><strong>-nowait</strong></span> 
75            </p>
76            <p>
77                 If a lock is unavailable for any Berkeley DB operation performed in
78                 the context of this transaction, throw a Tcl error immediately instead
79                 of blocking on the lock.
80            </p>
81          </li>
82          <li>
83            <p>
84                  <span class="bold"><strong>-parent txnid</strong></span> 
85            </p>
86            <p>
87                 Create the new transaction as a nested transaction, with the specified
88                 transaction indicated as its parent.  Transactions may be nested to
89                 any level.
90            </p>
91          </li>
92          <li>
93            <p>
94                  <span class="bold"><strong>-sync</strong></span> 
95            </p>
96            <p>
97                 Synchronously flush the log when this transaction commits or prepares.
98                 This means the transaction will exhibit all of the ACID (atomicity,
99                 consistency, isolation, and durability) properties.     
100             </p>
101            <p>
102                 This behavior is the default for Berkeley DB environments unless the
103                 <span class="bold"><strong>-nosync</strong></span> option was specified to the
104                 <span class="bold"><strong>berkdb env</strong></span> call.
105            </p>
106          </li>
107        </ul>
108      </div>
109      <p>
110         The <span class="emphasis"><em>env</em></span> <span class="bold"><strong>txn</strong></span>
111         command returns a transaction handle on success.
112    </p>
113      <p>
114        In the case of error, a Tcl error is thrown.
115    </p>
116    </div>
117    <div class="navfooter">
118      <hr />
119      <table width="100%" summary="Navigation footer">
120        <tr>
121          <td width="40%" align="left"><a accesskey="p" href="env_remove.html">Prev</a>��</td>
122          <td width="20%" align="center">
123            <a accesskey="u" href="tclapi.html">Up</a>
124          </td>
125          <td width="40%" align="right">��<a accesskey="n" href="txn_abort.html">Next</a></td>
126        </tr>
127        <tr>
128          <td width="40%" align="left" valign="top">berkdb envremove��</td>
129          <td width="20%" align="center">
130            <a accesskey="h" href="index.html">Home</a>
131          </td>
132          <td width="40%" align="right" valign="top">��<span class="emphasis"><em>txn</em></span> abort</td>
133        </tr>
134      </table>
135    </div>
136  </body>
137</html>
138