<spanclass="bold"><strong>I'm using multiple processes to access an Berkeley DB database
environment; is there any way to ensure that two processes don't run transactional
recovery at the same time, or that all processes have exited the database
environment so that recovery can be run?</strong></span>
</p>
<p>
See <aclass="xref"href="transapp_fail.html"title="Handling failure in Transactional Data Store applications">Handling failure in Transactional Data Store applications</a> and
<aclass="xref"href="transapp_app.html"title="Architecting Transactional Data Store applications">Architecting Transactional Data Store applications</a> for a full
discussion of this topic.
</p>
</li>
<li>
<p>
<spanclass="bold"><strong>How can I associate application information with a <ahref="../api_reference/C/db.html"class="olink">DB</a> or
In the C API, the <ahref="../api_reference/C/db.html"class="olink">DB</a> and <ahref="../api_reference/C/env.html"class="olink">DB_ENV</a> structures each contain an "app_private" field intended
to be used to reference application-specific information. See the <ahref="../api_reference/C/dbcreate.html"class="olink">db_create()</a> and
<ahref="../api_reference/C/envcreate.html"class="olink">db_env_create()</a> documentation for more information.
</p>
<p>
In the C++ or Java APIs, the easiest way to associate application-specific data with a
handle is to subclass the <ahref="../api_reference/CXX/db.html"class="olink">Db</a> or <ahref="../api_reference/CXX/env.html"class="olink">DbEnv</a>, for example subclassing
<ahref="../api_reference/CXX/db.html"class="olink">Db</a> to get MyDb. Objects of type MyDb will still have the Berkeley DB API
methods available on them, and you can put any extra data or methods you want into the
MyDb class. If you are using "callback" APIs that take <ahref="../api_reference/CXX/db.html"class="olink">Db</a> or
<ahref="../api_reference/CXX/env.html"class="olink">DbEnv</a> arguments (for example,
these will always be called with the <ahref="../api_reference/CXX/db.html"class="olink">Db</a> or <ahref="../api_reference/CXX/env.html"class="olink">DbEnv</a> objects you
create. So if you always use MyDb objects, you will be able to take the first argument
to the callback function and cast it to a MyDb (in C++, cast it to (MyDb*)). That will