2
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
4
<!--See the file LICENSE for redistribution information.-->
7
<title>Berkeley DB Reference Guide: Why transactions?</title>
8
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
9
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
12
<table width="100%"><tr valign=top>
13
<td><h3><dl><dt>Berkeley DB Reference Guide:<dd>Berkeley DB Transactional Data Store Applications</dl></h3></td>
14
<td align=right><a href="../../ref/transapp/intro.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/transapp/term.html"><img src="../../images/next.gif" alt="Next"></a>
17
<h1 align=center>Why transactions?</h1>
18
<p>Perhaps the first question to answer is "Why transactions?" There are
19
a number of reasons to include transactional support in your applications.
20
The most common ones are the following:
22
<p><dt>Recoverability<dd>Applications often need to ensure that no matter how the system or
23
application fails, previously saved data is available the next time the
25
<p><dt>Atomicity<dd>Applications may need to make multiple changes to one or more databases,
26
but ensure that either all of the changes happen, or none of them
27
happens. Transactions guarantee that a group of changes are atomic;
28
that is, if the application or system fails, either all of the changes
29
to the databases will appear when the application next runs, or none of
31
<p><dt>Isolation<dd>Applications may need to make changes in isolation, that is, ensure that
32
only a single thread of control is modifying a key/data pair at a time.
33
Transactions ensure each thread of control sees all records as if all
34
other transactions either completed before or after its transaction.
36
<table width="100%"><tr><td><br></td><td align=right><a href="../../ref/transapp/intro.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/transapp/term.html"><img src="../../images/next.gif" alt="Next"></a>
38
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>