• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/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>txn commit</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="txn_checkpoint.html" title="env txn_checkpoint" />
12    <link rel="next" href="version.html" title="berkdb version" />
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>txn</em></span> commit</th>
19        </tr>
20        <tr>
21          <td width="20%" align="left"><a accesskey="p" href="txn_checkpoint.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="version.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_commit"></a><span class="emphasis"><em>txn</em></span> commit</h2>
35          </div>
36        </div>
37      </div>
38      <pre class="programlisting">txn commit
39	[-nosync]
40	[-sync]  </pre>
41      <p>
42         The <span class="emphasis"><em>txn</em></span> <span class="bold"><strong>commit</strong></span>
43         command ends the transaction.
44    </p>
45      <p>
46         In the case of nested transactions, if the transaction is a parent
47         transaction with unresolved (neither committed or aborted) child
48         transactions, the child transactions are aborted and the commit of the
49         parent will succeed.
50    </p>
51      <p>
52         In the case of nested transactions, if the transaction is a child
53         transaction, its locks are not released, but are acquired by its
54         parent. Although the commit of the child transaction will succeed, the
55         actual resolution of the child transaction is postponed until the
56         parent transaction is committed or aborted; that is, if its parent
57         transaction commits, it will be committed, and if its parent
58         transaction aborts, it will be aborted.
59    </p>
60      <p>
61         If the <span class="bold"><strong>-nosync</strong></span> option is not
62         specified, a commit log record is written and flushed to disk, as are
63         all previously written log records.
64    </p>
65      <p>
66        The options are as follows:
67    </p>
68      <div class="itemizedlist">
69        <ul type="disc">
70          <li>
71            <p>
72                 <span class="bold"><strong>-nosync</strong></span> 
73            </p>
74            <p>
75                 Do not synchronously flush the log. This means the transaction will
76                 exhibit the ACI (atomicity, consistency, and isolation) properties,
77                 but not D (durability); that is, database integrity will be
78                 maintained, but it is possible that this transaction may be undone
79                 during recovery instead of being redone.     
80             </p>
81            <p>
82                 This behavior may be set for an entire Berkeley DB environment as part
83                 of the <span class="bold"><strong>berkdb env</strong></span> call.
84            </p>
85          </li>
86          <li>
87            <p>
88                  <span class="bold"><strong>-sync</strong></span> 
89            </p>
90            <p>
91                 Synchronously flush the log. This means the transaction will exhibit
92                 all of the ACID (atomicity, consistency, isolation and durability)
93                 properties.     
94             </p>
95            <p>
96                 This behavior is the default for Berkeley DB environments unless the
97                 <span class="bold"><strong>-nosync</strong></span> option was specified to the
98                 <span class="bold"><strong>berkdb env</strong></span> or
99                 <span class="emphasis"><em>env</em></span> <span class="bold"><strong>txn</strong></span> calls.
100            </p>
101          </li>
102        </ul>
103      </div>
104      <p>
105         After <span class="emphasis"><em>txn</em></span> <span class="bold"><strong>commit</strong></span>
106         has been called, regardless of its return, the <span class="bold"><strong>txn</strong></span> handle may not be accessed again.  If
107         <span class="emphasis"><em>txn</em></span> <span class="bold"><strong>commit</strong></span>
108         encounters an error, this transaction and all child transactions of
109         this transaction are aborted.
110    </p>
111      <p>
112         The <span class="emphasis"><em>txn</em></span> <span class="bold"><strong>commit</strong></span>
113         command returns 0 on success, and in the case of error, a Tcl error is
114         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="txn_checkpoint.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="version.html">Next</a></td>
126        </tr>
127        <tr>
128          <td width="40%" align="left" valign="top"><span class="emphasis"><em>env</em></span> txn_checkpoint��</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">��berkdb version</td>
133        </tr>
134      </table>
135    </div>
136  </body>
137</html>
138