| 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>Why transactions?</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="Berkeley DB Programmer's Reference Guide" /> |
| 10 | <link rel="up" href="transapp.html" title="Chapter 11. Berkeley DB Transactional Data Store Applications" /> |
| 11 | <link rel="prev" href="transapp.html" title="Chapter 11. Berkeley DB Transactional Data Store Applications" /> |
| 12 | <link rel="next" href="transapp_term.html" title="Terminology" /> |
| 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">Why transactions?</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="transapp.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Chapter 11. |
| 26 | Berkeley DB Transactional Data Store Applications |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="transapp_term.html">Next</a></td> |
| 29 | </tr> |
| 30 | </table> |
| 31 | <hr /> |
| 32 | </div> |
| 33 | <div class="sect1" lang="en" xml:lang="en"> |
| 34 | <div class="titlepage"> |
| 35 | <div> |
| 36 | <div> |
| 37 | <h2 class="title" style="clear: both"><a id="transapp_why"></a>Why transactions?</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <p>Perhaps the first question to answer is "Why transactions?" There are |
| 42 | a number of reasons to include transactional support in your applications. |
| 43 | The most common ones are the following:</p> |
| 44 | <div class="variablelist"> |
| 45 | <dl> |
| 46 | <dt> |
| 47 | <span class="term">Recoverability</span> |
| 48 | </dt> |
| 49 | <dd>Applications often need to ensure that no matter how the system or |
| 50 | application fails, previously saved data is available the next time the |
| 51 | application runs. This is often called Durability.</dd> |
| 52 | <dt> |
| 53 | <span class="term">Atomicity</span> |
| 54 | </dt> |
| 55 | <dd>Applications may need to make multiple changes to one or more databases, |
| 56 | but ensure that either all of the changes happen, or none of them |
| 57 | happens. Transactions guarantee that a group of changes are atomic; |
| 58 | that is, if the application or system fails, either all of the changes |
| 59 | to the databases will appear when the application next runs, or none of |
| 60 | them.</dd> |
| 61 | <dt> |
| 62 | <span class="term">Isolation</span> |
| 63 | </dt> |
| 64 | <dd>Applications may need to make changes in isolation, that is, ensure that |
| 65 | only a single thread of control is modifying a key/data pair at a time. |
| 66 | Transactions ensure each thread of control sees all records as if all |
| 67 | other transactions either completed before or after its transaction.</dd> |
| 68 | </dl> |
| 69 | </div> |
| 70 | </div> |
| 71 | <div class="navfooter"> |
| 72 | <hr /> |
| 73 | <table width="100%" summary="Navigation footer"> |
| 74 | <tr> |
| 75 | <td width="40%" align="left"><a accesskey="p" href="transapp.html">Prev</a> </td> |
| 76 | <td width="20%" align="center"> |
| 77 | <a accesskey="u" href="transapp.html">Up</a> |
| 78 | </td> |
| 79 | <td width="40%" align="right"> <a accesskey="n" href="transapp_term.html">Next</a></td> |
| 80 | </tr> |
| 81 | <tr> |
| 82 | <td width="40%" align="left" valign="top">Chapter 11. |
| 83 | Berkeley DB Transactional Data Store Applications |
| 84 | </td> |
| 85 | <td width="20%" align="center"> |
| 86 | <a accesskey="h" href="index.html">Home</a> |
| 87 | </td> |
| 88 | <td width="40%" align="right" valign="top"> Terminology</td> |
| 89 | </tr> |
| 90 | </table> |
| 91 | </div> |
| 92 | </body> |
| 93 | </html> |