Debian Codegraph @

docs/api_reference/CXX/txnset_timeout.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>DbTxn::set_timeout()</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="txnset_priority.html" title="DbTxn::set_priority()" />
12 <link rel="next" href="utilities.html" title="Appendix A.  Berkeley DB Command Line Utilities" />
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">DbTxn::set_timeout()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="txnset_priority.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 13. 
26 The DbTxn Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="utilities.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="txnset_timeout"></a>DbTxn::set_timeout()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 u_int32_t
44 DbTxn::set_timeout(db_timeout_t timeout, u_int32_t flags);</pre>
45 <p>
46 The <code class="methodname">DbTxn::set_timeout()</code> method sets timeout values for locks or
47 transactions for the specified transaction.
48 </p>
49 <p>
50 Timeouts are checked whenever a thread of control blocks on a lock or
51 when deadlock detection is performed. In the case of
52 <code class="literal">DB_SET_LOCK_TIMEOUT</code>, the timeout is for any single lock request. In
53 the case of <code class="literal">DB_SET_TXN_TIMEOUT</code>, the timeout is for the life of the
54 transaction. As timeouts are only checked when the lock request first
55 blocks or when deadlock detection is performed, the accuracy of the
56 timeout depends on how often deadlock detection is performed.
57 </p>
58 <p>
59 Timeout values may be specified for the database environment as a
60 whole. Also, the database environment must enable the locking
61 subsystem before timeout values can be specified. See
62 <a class="xref" href="envset_timeout.html" title="DbEnv::set_timeout()">DbEnv::set_timeout()</a>
63 for more information.
64 </p>
65 <p>
66 The <code class="methodname">DbTxn::set_timeout()</code> method configures operations performed on
67 the underlying transaction, not only operations performed using the
68 specified <a class="link" href="txn.html" title="Chapter 13.  The DbTxn Handle">DbTxn</a> handle.
69 </p>
70 <p>
71 The <code class="methodname">DbTxn::set_timeout()</code> method may be called at any time during the
72 life of the application.
73 </p>
74 <p>
75 The <code class="methodname">DbTxn::set_timeout()</code> <span>
76
77 <span>
78 method either returns a non-zero error value or throws an
79 exception that encapsulates a non-zero error value on
80 failure, and returns 0 on success.
81 </span>
82 </span>
83 </p>
84 <div class="sect2" lang="en" xml:lang="en">
85 <div class="titlepage">
86 <div>
87 <div>
88 <h3 class="title"><a id="idp10531776"></a>Parameters</h3>
89 </div>
90 </div>
91 </div>
92 <div class="sect3" lang="en" xml:lang="en">
93 <div class="titlepage">
94 <div>
95 <div>
96 <h4 class="title"><a id="idp10531128"></a>timeout</h4>
97 </div>
98 </div>
99 </div>
100 <p>
101 The <span class="bold"><strong>timeout</strong></span> parameter is specified as
102 an unsigned 32-bit number of microseconds, limiting the maximum
103 timeout to roughly 71 minutes. A value of 0 disables timeouts for the
104 transaction.
105 </p>
106 </div>
107 <div class="sect3" lang="en" xml:lang="en">
108 <div class="titlepage">
109 <div>
110 <div>
111 <h4 class="title"><a id="idp10525504"></a>flags</h4>
112 </div>
113 </div>
114 </div>
115 <p>
116 The <span class="bold"><strong>flags</strong></span> parameter must be set to
117 one of the following values:
118 </p>
119 <div class="itemizedlist">
120 <ul type="disc">
121 <li>
122 <p>
123 <code class="literal">DB_SET_LOCK_TIMEOUT</code>
124 </p>
125 <p>
126 Set the timeout value for locks in this transaction.
127 </p>
128 </li>
129 <li>
130 <p>
131 <code class="literal">DB_SET_TXN_TIMEOUT</code>
132 </p>
133 <p>
134 Set the timeout value for this transaction.
135 </p>
136 </li>
137 </ul>
138 </div>
139 </div>
140 </div>
141 <div class="sect2" lang="en" xml:lang="en">
142 <div class="titlepage">
143 <div>
144 <div>
145 <h3 class="title"><a id="idp10541344"></a>Errors</h3>
146 </div>
147 </div>
148 </div>
149 <p>
150 The <code class="methodname">DbTxn::set_timeout()</code> <span>
151
152 <span>
153 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
154 exception, encapsulating one of the following non-zero errors, or return one
155 of the following non-zero errors:
156 </span>
157 </span>
158 </p>
159 <div class="sect3" lang="en" xml:lang="en">
160 <div class="titlepage">
161 <div>
162 <div>
163 <h4 class="title"><a id="idp10549344"></a>EINVAL</h4>
164 </div>
165 </div>
166 </div>
167 <p>
168 An invalid flag value or parameter was specified.
169 </p>
170 </div>
171 </div>
172 <div class="sect2" lang="en" xml:lang="en">
173 <div class="titlepage">
174 <div>
175 <div>
176 <h3 class="title"><a id="idp10548048"></a>Class</h3>
177 </div>
178 </div>
179 </div>
180 <p>
181 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>, <a class="link" href="txn.html" title="Chapter 13.  The DbTxn Handle">DbTxn</a>
182 </p>
183 </div>
184 <div class="sect2" lang="en" xml:lang="en">
185 <div class="titlepage">
186 <div>
187 <div>
188 <h3 class="title"><a id="idp10543384"></a>See Also</h3>
189 </div>
190 </div>
191 </div>
192 <p>
193 <a class="xref" href="txn.html#txnlist" title="Transaction Subsystem and Related Methods">Transaction Subsystem and Related Methods</a>
194 </p>
195 </div>
196 </div>
197 <div class="navfooter">
198 <hr />
199 <table width="100%" summary="Navigation footer">
200 <tr>
201 <td width="40%" align="left"><a accesskey="p" href="txnset_priority.html">Prev</a> </td>
202 <td width="20%" align="center">
203 <a accesskey="u" href="txn.html">Up</a>
204 </td>
205 <td width="40%" align="right"> <a accesskey="n" href="utilities.html">Next</a></td>
206 </tr>
207 <tr>
208 <td width="40%" align="left" valign="top">DbTxn::set_priority() </td>
209 <td width="20%" align="center">
210 <a accesskey="h" href="index.html">Home</a>
211 </td>
212 <td width="40%" align="right" valign="top"> Appendix A. 
213 Berkeley DB Command Line Utilities
214 </td>
215 </tr>
216 </table>
217 </div>
218 </body>
219 </html>