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>DbEnv::set_tx_timestamp()</title> 7 <link rel="stylesheet" href="apiReference.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 C++ API Reference" /> 10 <link rel="up" href="txn.html" title="Chapter 13. The DbTxn Handle" /> 11 <link rel="prev" href="envset_tx_max.html" title="DbEnv::set_tx_max()" /> 12 <link rel="next" href="txnabort.html" title="DbTxn::abort()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DbEnv::set_tx_timestamp()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="envset_tx_max.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 13. 23 The DbTxn Handle 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="txnabort.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="envset_tx_timestamp"></a>DbEnv::set_tx_timestamp()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int 41DbEnv::set_tx_timestamp(time_t *timestamp); </pre> 42 <p> 43 Recover to the time specified by <span class="bold"><strong>timestamp</strong></span> rather than to the most current 44 possible date. 45 </p> 46 <p> 47 Once a database environment has been upgraded to a new version of 48 Berkeley DB involving a log format change (see <a href="../../programmer_reference/upgrade_process.html" class="olink">Upgrading Berkeley DB installations</a>), it is no longer possible to recover to a 49 specific time before that upgrade. 50 </p> 51 <p> 52 The <code class="methodname">DbEnv::set_tx_timestamp()</code> method configures operations performed 53 using the specified <a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</a> handle, not all 54 operations performed on the underlying database environment. 55 </p> 56 <p> 57 The <code class="methodname">DbEnv::set_tx_timestamp()</code> method may not be called after the 58 <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> method is 59 called. 60 </p> 61 <p> 62 The <code class="methodname">DbEnv::set_tx_timestamp()</code> <span> 63 64 <span> 65 method either returns a non-zero error value or throws an 66 exception that encapsulates a non-zero error value on 67 failure, and returns 0 on success. 68 </span> 69 </span> 70 </p> 71 <div class="sect2" lang="en" xml:lang="en"> 72 <div class="titlepage"> 73 <div> 74 <div> 75 <h3 class="title"><a id="id1713046"></a>Parameters</h3> 76 </div> 77 </div> 78 </div> 79 <div class="sect3" lang="en" xml:lang="en"> 80 <div class="titlepage"> 81 <div> 82 <div> 83 <h4 class="title"><a id="id1713269"></a>timestamp</h4> 84 </div> 85 </div> 86 </div> 87 <p> 88 The <span class="bold"><strong>timestamp</strong></span> parameter references 89 the memory location where the recovery timestamp is located. 90 </p> 91 <p> 92 The <span class="bold"><strong>timestamp</strong></span> parameter should be the 93 number of seconds since 0 hours, 0 minutes, 0 seconds, January 1, 94 1970, Coordinated Universal Time; that is, the Epoch. 95 </p> 96 </div> 97 </div> 98 <div class="sect2" lang="en" xml:lang="en"> 99 <div class="titlepage"> 100 <div> 101 <div> 102 <h3 class="title"><a id="id1713249"></a>Errors</h3> 103 </div> 104 </div> 105 </div> 106 <p> 107 The <code class="methodname">DbEnv::set_tx_timestamp()</code> <span> 108 109 <span> 110 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> 111 exception, encapsulating one of the following non-zero errors, or return one 112 of the following non-zero errors: 113 </span> 114 </span> 115 </p> 116 <div class="sect3" lang="en" xml:lang="en"> 117 <div class="titlepage"> 118 <div> 119 <div> 120 <h4 class="title"><a id="id1713058"></a>EINVAL</h4> 121 </div> 122 </div> 123 </div> 124 <p> 125 If it is not possible to recover to the specified time using the log 126 files currently present in the environment; or if an invalid flag 127 value or parameter was specified. 128 </p> 129 </div> 130 </div> 131 <div class="sect2" lang="en" xml:lang="en"> 132 <div class="titlepage"> 133 <div> 134 <div> 135 <h3 class="title"><a id="id1713313"></a>Class</h3> 136 </div> 137 </div> 138 </div> 139 <p> 140 <a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</a>, 141 <a class="link" href="txn.html" title="Chapter 13. The DbTxn Handle">DbTxn</a> 142 </p> 143 </div> 144 <div class="sect2" lang="en" xml:lang="en"> 145 <div class="titlepage"> 146 <div> 147 <div> 148 <h3 class="title"><a id="id1712840"></a>See Also</h3> 149 </div> 150 </div> 151 </div> 152 <p> 153 <a class="xref" href="txn.html#txnlist" title="Transaction Subsystem and Related Methods">Transaction Subsystem and Related Methods</a> 154 </p> 155 </div> 156 </div> 157 <div class="navfooter"> 158 <hr /> 159 <table width="100%" summary="Navigation footer"> 160 <tr> 161 <td width="40%" align="left"><a accesskey="p" href="envset_tx_max.html">Prev</a> </td> 162 <td width="20%" align="center"> 163 <a accesskey="u" href="txn.html">Up</a> 164 </td> 165 <td width="40%" align="right"> <a accesskey="n" href="txnabort.html">Next</a></td> 166 </tr> 167 <tr> 168 <td width="40%" align="left" valign="top">DbEnv::set_tx_max() </td> 169 <td width="20%" align="center"> 170 <a accesskey="h" href="index.html">Home</a> 171 </td> 172 <td width="40%" align="right" valign="top"> DbTxn::abort()</td> 173 </tr> 174 </table> 175 </div> 176 </body> 177</html> 178