1<!--$Id: env_set_tx_timestamp.so,v 10.29 2004/09/28 15:04:23 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB: DbEnv::set_tx_timestamp</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td> 13<b>DbEnv::set_tx_timestamp</b> 14</td> 15<td align=right> 16<a href="/api_cxx/api_core.html"><img src="/images/api.gif" alt="API"></a> 17<a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a></td> 18</tr></table> 19<hr size=1 noshade> 20<tt> 21<b><pre> 22#include <db_cxx.h> 23<p> 24int 25DbEnv::set_tx_timestamp(time_t *timestamp); 26<p> 27int 28DbEnv::get_tx_timestamp(time_t *timestampp); 29</pre></b> 30<hr size=1 noshade> 31<b>Description: DbEnv::set_tx_timestamp</b> 32<p>Recover to the time specified by <b>timestamp</b> rather than to the 33most current possible date.</p> 34<p>Once a database environment has been upgraded to a new version of Berkeley DB 35involving a log format change (see <a href="/ref/upgrade/process.html">Upgrading Berkeley DB installations</a>), it is no longer possible to recover 36to a specific time before that upgrade.</p> 37<p>The DbEnv::set_tx_timestamp method configures operations performed using the specified 38<a href="/api_cxx/env_class.html">DbEnv</a> handle, not all operations performed on the underlying 39database environment.</p> 40<p>The DbEnv::set_tx_timestamp method may not be called after the <a href="/api_cxx/env_open.html">DbEnv::open</a> method is 41called. 42</p> 43<p>The DbEnv::set_tx_timestamp method 44either returns a non-zero error value 45or throws an exception that encapsulates a non-zero error value on 46failure, and returns 0 on success. 47</p> 48<b>Parameters</b> <br> 49 <b>timestamp</b><ul compact><li>The <b>timestamp</b> parameter references the memory location where the 50recovery timestamp is located. 51<p>The <b>timestamp</b> parameter should be the number of seconds since 0 52hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal 53Time; that is, the Epoch.</p></ul> 54<br> 55<br><b>Errors</b> 56<p>The DbEnv::set_tx_timestamp method 57may fail and throw 58<a href="/api_cxx/except_class.html">DbException</a>, 59encapsulating one of the following non-zero errors, or return one of 60the following non-zero errors:</p> 61<br> 62<b>EINVAL</b><ul compact><li>If it is not possible to recover to the specified time using the log files 63currently present in the environment; or if an 64invalid flag value or parameter was specified.</ul> 65<br> 66<hr size=1 noshade> 67<b>Description: DbEnv::get_tx_timestamp</b> 68<p>The DbEnv::get_tx_timestamp method returns the recovery timestamp.</p> 69<p>The DbEnv::get_tx_timestamp method may be called at any time during the life of the 70application.</p> 71<p>The DbEnv::get_tx_timestamp method 72either returns a non-zero error value 73or throws an exception that encapsulates a non-zero error value on 74failure, and returns 0 on success. 75</p> 76<b>Parameters</b> <br> 77 <b>timestampp</b><ul compact><li>The DbEnv::get_tx_timestamp method returns the 78recovery timestamp in <b>timestampp</b>.</ul> 79<br> 80<hr size=1 noshade> 81<br><b>Class</b> 82<a href="/api_cxx/env_class.html">DbEnv</a>, <a href="/api_cxx/txn_class.html">DbTxn</a> 83<br><b>See Also</b> 84<a href="/api_cxx/txn_list.html">Transaction Subsystem and Related Methods</a> 85</tt> 86<table width="100%"><tr><td><br></td><td align=right> 87<a href="/api_cxx/api_core.html"><img src="/images/api.gif" alt="API"></a><a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a> 88</td></tr></table> 89<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 90</body> 91</html> 92