env_set_timeout.html   [plain text]


<!--$Id: env_set_timeout.so,v 10.24 2005/05/20 15:07:45 bostic Exp $-->
<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB: DB_ENV-&gt;set_timeout</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
</head>
<body bgcolor=white>
<table width="100%"><tr valign=top>
<td>
<b>DB_ENV-&gt;set_timeout</b>
</td>
<td align=right>
<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a>
<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td>
</tr></table>
<hr size=1 noshade>
<tt>
<b><pre>
#include &lt;db.h&gt;
<p>
int
DB_ENV-&gt;set_timeout(DB_ENV *dbenv, db_timeout_t timeout, u_int32_t flags);
<p>
int
DB_ENV-&gt;get_timeout(DB_ENV *dbenv, db_timeout_t *timeoutp, u_int32_t flag);
</pre></b>
<hr size=1 noshade>
<b>Description: DB_ENV-&gt;set_timeout</b>
<p>The DB_ENV-&gt;set_timeout method sets timeout values for locks or
transactions in the database environment.</p>
<p>All timeouts are checked whenever a thread of control blocks on a lock
or when deadlock detection is performed.  (In the case of
DB_SET_LOCK_TIMEOUT, the lock is one requested explicitly
through the Lock subsystem interfaces.  In the case of
DB_SET_TXN_TIMEOUT, the lock is one requested on behalf of a
transaction.  In either case, it may be a lock requested by the database
access methods underlying the application.)  As timeouts are only
checked when the lock request first blocks or when deadlock detection
is performed, the accuracy of the timeout depends on how often deadlock
detection is performed.</p>
<p>Timeout values specified for the database environment may be overridden
on a per-lock or per-transaction basis.  See <a href="../api_c/lock_vec.html">DB_ENV-&gt;lock_vec</a> and
<a href="../api_c/txn_set_timeout.html">DB_TXN-&gt;set_timeout</a> for more information.</p>
<p>The DB_ENV-&gt;set_timeout method configures a database environment, not only operations
performed using the specified <a href="../api_c/env_class.html">DB_ENV</a> handle.</p>
<p>The DB_ENV-&gt;set_timeout method may be called at any time during the life of the
application.</p>
<p>The DB_ENV-&gt;set_timeout method
returns a non-zero error value on failure
and 0 on success.
</p>
<b>Parameters</b> <br>
 <b>flags</b><ul compact><li>The <b>flags</b> parameter must be set to one of the following values:
<br>
<b><a name="DB_SET_LOCK_TIMEOUT">DB_SET_LOCK_TIMEOUT</a></b><ul compact><li>Set the timeout value for locks in this database environment.
<p>The database environment's lock timeout value may also be configured using the
environment's <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file.  The syntax of the entry in that
file is a single line with the string "set_lock_timeout", one or more whitespace
characters, and the lock timeout value.
Because the <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file is read when the database environment
is opened, it will silently overrule configuration done before that
time.</p></ul>
<b><a name="DB_SET_TXN_TIMEOUT">DB_SET_TXN_TIMEOUT</a></b><ul compact><li>Set the timeout value for transactions in this database environment.
<p>The database environment's transaction timeout value may also be configured using the
environment's <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file.  The syntax of the entry in that
file is a single line with the string "set_txn_timeout", one or more whitespace
characters, and the transaction timeout value.
Because the <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file is read when the database environment
is opened, it will silently overrule configuration done before that
time.</p></ul>
<br>
 <b>timeout</b><ul compact><li>The <b>timeout</b> parameter is the timeout value.  It must be specified
as an unsigned 32-bit number of microseconds, limiting the maximum timeout
to roughly 71 minutes.</ul></ul>
<br>
<br><b>Errors</b>
<p>The DB_ENV-&gt;set_timeout method
may fail and return one of the following non-zero errors:</p>
<br>
<b>EINVAL</b><ul compact><li>An
invalid flag value or parameter was specified.</ul>
<br>
<hr size=1 noshade>
<b>Description: DB_ENV-&gt;get_timeout</b>
<p>The DB_ENV-&gt;get_timeout method returns a timeout value, in microseconds.</p>
<p>The DB_ENV-&gt;get_timeout method may be called at any time during the life of the
application.</p>
<p>The DB_ENV-&gt;get_timeout method
returns a non-zero error value on failure
and 0 on success.
</p>
<b>Parameters</b> <br>
 <b>flag</b><ul compact><li>The <b>flags</b> parameter must be set to one of the following values:
<br>
<b><a name="DB_SET_LOCK_TIMEOUT">DB_SET_LOCK_TIMEOUT</a></b><ul compact><li>Return the timeout value for locks in this database environment.</ul>
<b><a name="DB_SET_TXN_TIMEOUT">DB_SET_TXN_TIMEOUT</a></b><ul compact><li>Return the timeout value for transactions in this database environment.</ul>
<br></ul>
 <b>timeoutp</b><ul compact><li>The <b>timeoutp</b> parameter references memory into which
 the timeout value of the specified <b>flag</b> parameter is copied.</ul> 
<br>
<hr size=1 noshade>
<br><b>Class</b>
<a href="../api_c/env_class.html">DB_ENV</a>
<br><b>See Also</b>
<a href="../api_c/env_list.html">Database Environments and Related Methods</a>
</tt>
<table width="100%"><tr><td><br></td><td align=right>
<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a>
</td></tr></table>
<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
</body>
</html>