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="preface.html" title="Preface" /> 12 <link rel="next" href="sysfailure.html" title="A Note on System Failure" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">Chapter��1.��Introduction</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="preface.html">Prev</a>��</td> 22 <th width="60%" align="center">��</th> 23 <td width="20%" align="right">��<a accesskey="n" href="sysfailure.html">Next</a></td> 24 </tr> 25 </table> 26 <hr /> 27 </div> 28 <div class="chapter" lang="en" xml:lang="en"> 29 <div class="titlepage"> 30 <div> 31 <div> 32 <h2 class="title"><a id="introduction"></a>Chapter��1.��Introduction</h2> 33 </div> 34 </div> 35 </div> 36 <div class="toc"> 37 <p> 38 <b>Table of Contents</b> 39 </p> 40 <dl> 41 <dt> 42 <span class="sect1"> 43 <a href="introduction.html#txnintro">Transaction Benefits</a> 44 </span> 45 </dt> 46 <dt> 47 <span class="sect1"> 48 <a href="sysfailure.html">A Note on System Failure</a> 49 </span> 50 </dt> 51 <dt> 52 <span class="sect1"> 53 <a href="apireq.html">Application Requirements</a> 54 </span> 55 </dt> 56 <dt> 57 <span class="sect1"> 58 <a href="multithread-intro.html">Multi-threaded 59 <span>and Multi-process</span> 60 Applications</a> 61 </span> 62 </dt> 63 <dt> 64 <span class="sect1"> 65 <a href="recovery-intro.html">Recoverability</a> 66 </span> 67 </dt> 68 <dt> 69 <span class="sect1"> 70 <a href="perftune-intro.html">Performance Tuning</a> 71 </span> 72 </dt> 73 </dl> 74 </div> 75 <p> 76 This book provides a thorough introduction and discussion on transactions as 77 used with Berkeley DB (DB). 78 79 <span> 80 Both the base API as well as the Direct Persistence Layer API is used in this 81 manual. 82 </span> 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="usingtxns.html#nodurabletxn" 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="preface.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">Preface��</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> 212