Debian Codegraph @

docs/gsg_txn/CXX/introduction.html

raw
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>Chapter 1. Introduction</title>
7 <link rel="stylesheet" href="gettingStarted.css" type="text/css" />
8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9 <link rel="start" href="index.html" title="Getting Started with Berkeley DB Transaction Processing" />
10 <link rel="up" href="index.html" title="Getting Started with Berkeley DB Transaction Processing" />
11 <link rel="prev" href="moreinfo.html" title="For More Information" />
12 <link rel="next" href="sysfailure.html" title="A Note on System Failure" />
13 </head>
14 <body>
15 <div xmlns="" class="navheader">
16 <div class="libver">
17 <p>Library Version 11.2.5.3</p>
18 </div>
19 <table width="100%" summary="Navigation header">
20 <tr>
21 <th colspan="3" align="center">Chapter 1. Introduction</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="moreinfo.html">Prev</a> </td>
25 <th width="60%" align="center"> </th>
26 <td width="20%" align="right"> <a accesskey="n" href="sysfailure.html">Next</a></td>
27 </tr>
28 </table>
29 <hr />
30 </div>
31 <div class="chapter" lang="en" xml:lang="en">
32 <div class="titlepage">
33 <div>
34 <div>
35 <h2 class="title"><a id="introduction"></a>Chapter 1. Introduction</h2>
36 </div>
37 </div>
38 </div>
39 <div class="toc">
40 <p>
41 <b>Table of Contents</b>
42 </p>
43 <dl>
44 <dt>
45 <span class="sect1">
46 <a href="introduction.html#txnintro">Transaction Benefits</a>
47 </span>
48 </dt>
49 <dt>
50 <span class="sect1">
51 <a href="sysfailure.html">A Note on System Failure</a>
52 </span>
53 </dt>
54 <dt>
55 <span class="sect1">
56 <a href="apireq.html">Application Requirements</a>
57 </span>
58 </dt>
59 <dt>
60 <span class="sect1">
61 <a href="multithread-intro.html">Multi-threaded
62 <span>and Multi-process</span>
63 Applications</a>
64 </span>
65 </dt>
66 <dt>
67 <span class="sect1">
68 <a href="recovery-intro.html">Recoverability</a>
69 </span>
70 </dt>
71 <dt>
72 <span class="sect1">
73 <a href="perftune-intro.html">Performance Tuning</a>
74 </span>
75 </dt>
76 </dl>
77 </div>
78 <p>
79 This book provides a thorough introduction and discussion on transactions as
80 used with Berkeley DB (DB).
81
82
83
84 It begins by offering a general overview to
85 transactions, the guarantees they provide, and the general application
86 infrastructure required to obtain full transactional protection for your
87 data.
88 </p>
89 <p>
90 This book also provides detailed examples on how to write a
91 transactional application. Both single threaded and multi-threaded <span>(as well as multi-process
92 applications)</span> are discussed. A detailed description of various
93 backup and recovery strategies is included in this manual, as is a
94 discussion on performance considerations for your transactional application.
95 </p>
96 <p>
97 You should understand the concepts from the
98 <span>
99 <em class="citetitle">Getting Started with Berkeley DB</em>
100 </span>
101
102
103 guide before reading this book.
104 </p>
105 <div class="sect1" lang="en" xml:lang="en">
106 <div class="titlepage">
107 <div>
108 <div>
109 <h2 class="title" style="clear: both"><a id="txnintro"></a>Transaction Benefits</h2>
110 </div>
111 </div>
112 </div>
113 <p>
114 Transactions offer your application's data protection from
115 application or system failures. That is, DB transactions offer
116 your application full ACID support:
117 </p>
118 <div class="itemizedlist">
119 <ul type="disc">
120 <li>
121 <p>
122 <span class="bold"><strong>A</strong></span>tomicity
123 </p>
124 <p>
125 Multiple database operations are treated as a single unit of
126 work. Once committed, all write operations performed under
127 the protection of the transaction are saved to your databases.
128 Further, in the event that you abort a transaction, all write
129 operations performed during the transaction are discarded.
130 In this event, your database is left in the state it was in
131 before the transaction began, regardless of the number or
132 type of write operations you may have performed during the
133 course of the transaction.
134 </p>
135 <p>
136 Note that DB transactions can span one or more
137 database handles.
138 </p>
139 </li>
140 <li>
141 <p>
142 <span class="bold"><strong>C</strong></span>onsistency
143 </p>
144 <p>
145 Your databases will never see a partially completed
146 transaction. This is true even if your application fails while there are
147 in-progress transactions. If the application or system fails,
148 then either all of the database changes appear when the
149 application next runs, or none of them appear.
150 </p>
151 <p>
152 In other words, whatever consistency requirements your application has will never be violated by DB.
153 If, for example, your application requires every record to include an employee ID, and your
154 code faithfully adds that ID to its database records, then DB will never
155 violate that consistency requirement. The ID will remain in the database records until such a time as your
156 application chooses to delete it.
157 </p>
158 </li>
159 <li>
160 <p>
161 <span class="bold"><strong>I</strong></span>solation
162 </p>
163 <p>
164 While a transaction is in progress, your databases will appear
165 to the transaction as if there are no other operations
166 occurring outside of the transaction. That is, operations
167 wrapped inside a transaction will always have a clean and
168 consistent view of your databases. They never have to see
169 updates currently in progress under the protection of another transaction.
170 Note, however, that isolation guarantees can be
171
172 relaxed from the default setting. See
173 <a class="xref" href="isolation.html" title="Isolation">Isolation</a>
174 for more information.
175 </p>
176 </li>
177 <li>
178 <p>
179 <span class="bold"><strong>D</strong></span>urability
180 </p>
181 <p>
182 Once committed to your databases, your modifications will
183 persist even in the event of an application or system failure.
184 Note that like isolation, your durability guarantee can be
185 relaxed. See <a class="xref" href="nodurabletxn.html" title="Non-Durable Transactions">Non-Durable Transactions</a>
186 for more information.
187 </p>
188 </li>
189 </ul>
190 </div>
191 </div>
192 </div>
193 <div class="navfooter">
194 <hr />
195 <table width="100%" summary="Navigation footer">
196 <tr>
197 <td width="40%" align="left"><a accesskey="p" href="moreinfo.html">Prev</a> </td>
198 <td width="20%" align="center"> </td>
199 <td width="40%" align="right"> <a accesskey="n" href="sysfailure.html">Next</a></td>
200 </tr>
201 <tr>
202 <td width="40%" align="left" valign="top">For More Information </td>
203 <td width="20%" align="center">
204 <a accesskey="h" href="index.html">Home</a>
205 </td>
206 <td width="40%" align="right" valign="top"> A Note on System Failure</td>
207 </tr>
208 </table>
209 </div>
210 </body>
211 </html>