1<!--$Id: env_set_feedback.so,v 10.43 2006/05/17 20:47:46 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_feedback</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_feedback</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 &lt;db_cxx.h&gt;
23<p>
24int
25DbEnv::set_feedback(void (*db_feedback_fcn)(DbEnv *dbenv, int opcode, int percent));
26</pre></b>
27<hr size=1 noshade>
28<b>Description: DbEnv::set_feedback</b>
29<p>Some operations performed by the Berkeley DB library can take non-trivial
30amounts of time.  The DbEnv::set_feedback method can be used by applications
31to monitor progress within these operations.  When an operation is
32likely to take a long time, Berkeley DB will call the specified callback
33function with progress information.</p>
34<p>It is up to the callback function to display this information in an
35appropriate manner.</p>
36<p>The DbEnv::set_feedback method configures operations performed using the specified
37<a href="../api_cxx/env_class.html">DbEnv</a> handle
38<p>The DbEnv::set_feedback method may be called at any time during the life of the
39application.</p>
40<p>The DbEnv::set_feedback method
41either returns a non-zero error value
42or throws an exception that encapsulates a non-zero error value on
43failure, and returns 0 on success.
44</p>
45<b>Parameters</b> <br>
46 <b>db_feedback_fcn</b><ul compact><li>The <b>db_feedback_fcn</b> parameter is the application-specified
47feedback function called to report Berkeley DB operation progress.  The
48callback function must take three parameters:
49<br>
50<b><b>dbenv</b></b><ul compact><li>The <b>dbenv</b> parameter is a reference to the enclosing database
51environment.</ul>
52<b><b>opcode</b></b><ul compact><li>The <b>opcode</b> parameter is an operation code.  The <b>opcode</b>
53parameter may take on any of the following values:
54<br>
55<b><a name="DB_RECOVER">DB_RECOVER</a></b><ul compact><li>The environment is being recovered.</ul>
56<br></ul>
57<b><b>percent</b></b><ul compact><li>The <b>percent</b> parameter is the percent of the operation that has
58been completed, specified as an integer value between 0 and 100.</ul>
59<br></ul>
60<p>Berkeley DB is not re-entrant.  Callback functions should not attempt to make
61library calls (for example, to release locks or close open handles).
62Re-entering Berkeley DB is not guaranteed to work correctly, and the results
63are undefined.</p>
64<br>
65<hr size=1 noshade>
66<br><b>Class</b>
67<a href="../api_cxx/env_class.html">DbEnv</a>
68<br><b>See Also</b>
69<a href="../api_cxx/env_list.html">Database Environments and Related Methods</a>
70</tt>
71<table width="100%"><tr><td><br></td><td align=right>
72<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>
73</td></tr></table>
74<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
75</body>
76</html>
77