Debian Codegraph @

docs/programmer_reference/am_sync.html

raw symbols SCIP
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>Flushing the database cache</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="am.html" title="Chapter 3.  Access Method Operations" />
11 <link rel="prev" href="am_verify.html" title="Database verification and salvage" />
12 <link rel="next" href="am_close.html" title="Database close" />
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">Flushing the database cache</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="am_verify.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 3. 
26 Access Method Operations
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="am_close.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="am_sync"></a>Flushing the database cache</h2>
38 </div>
39 </div>
40 </div>
41 <p>The <a href="../api_reference/C/dbsync.html" class="olink">DB-&gt;sync()</a> method flushes all modified records from the database
42 cache to disk.</p>
43 <p>
44 <span class="bold">
45 <strong>It is important to understand that flushing cached information
46 to disk only minimizes the window of opportunity for corrupted data, it
47 does not eliminate the possibility.</strong>
48 </span>
49 </p>
50 <p>While unlikely, it is possible for database corruption to happen if a
51 system or application crash occurs while writing data to the database. To
52 ensure that database corruption never occurs, applications must either:</p>
53 <div class="itemizedlist">
54 <ul type="disc">
55 <li>Use transactions and logging with automatic recovery.</li>
56 <li>Use logging and application-specific recovery.</li>
57 <li>Edit a copy of the database, and, once all applications
58 using the database have successfully called <a href="../api_reference/C/dbclose.html" class="olink">DB-&gt;close()</a>, use
59 system operations (for example, the POSIX rename system call) to
60 atomically replace the original database with the updated copy.</li>
61 </ul>
62 </div>
63 </div>
64 <div class="navfooter">
65 <hr />
66 <table width="100%" summary="Navigation footer">
67 <tr>
68 <td width="40%" align="left"><a accesskey="p" href="am_verify.html">Prev</a> </td>
69 <td width="20%" align="center">
70 <a accesskey="u" href="am.html">Up</a>
71 </td>
72 <td width="40%" align="right"> <a accesskey="n" href="am_close.html">Next</a></td>
73 </tr>
74 <tr>
75 <td width="40%" align="left" valign="top">Database verification and salvage </td>
76 <td width="20%" align="center">
77 <a accesskey="h" href="index.html">Home</a>
78 </td>
79 <td width="40%" align="right" valign="top"> Database close</td>
80 </tr>
81 </table>
82 </div>
83 </body>
84 </html>