gecko-dev/db/man/man.html/DbException.html

88 строки
4.4 KiB
HTML

<HTML>
<HEAD>
<TITLE>DbException</TITLE>
</HEAD>
<BODY BGCOLOR=white>
<H1>DbException</H1>
<HR SIZE=1 NOSHADE>
<PRE>
<!-- Manpage converted by man2html 3.0.1 -->
<B>#include</B> <B>&lt;db</B>_<B>cxx.h&gt;</B>
<B>DbException::DbException(int</B> <B>err);</B>
<B>DbException::DbException(const</B> <B>char</B> <B>*description);</B>
<B>DbException::DbException(const</B> <B>char</B> <B>*prefix,</B> <B>int</B> <B>err);</B>
<B>DbException::DbException(const</B> <B>char</B> <B>*prefix1,</B>
<B>const</B> <B>char</B> <B>*prefix2,</B> <B>int</B> <B>err);</B>
<B>const</B> <B>int</B>
<B>DbException::get</B>_<B>errno();</B>
<B>virtual</B> <B>const</B> <B>char</B> <B>*</B>
<B>DbException::what()</B> <B>const;</B>
</PRE>
<H2>DESCRIPTION</H2><PRE>
The DB library is a family of classes that provides a
modular programming interface to transactions and record-
oriented file access. The library includes support for
transactions, locking, logging and file page caching, as
well as various indexed access methods. Many of the
classes (e.g., the file page caching class) are useful
independent of the other DB classes, although some classes
are explicitly based on other classes (e.g., transactions
and logging). For a general description of the DB
package, see <B><A HREF="db_intro.html">db_intro(3)</A></B>.
This manual page describes the DbException class and how
it is used by the various Db* classes.
Most methods in the Db classes return an int but also
throw an exception. This allows for two different error
behaviors, that are known as error models. By default,
the error model is configured to throw an exception
whenever a serious error occurs. This generally allows
for cleaner logic for transaction processing, as a try
block can surround a single transaction. Alternatively,
the error model can be set to not throw exceptions, and
instead request the individual function to return an error
code. The error model can be changed using the
DbEnv::set_error_model method, see <B><A HREF="DbEnv.html">DbEnv(3)</A></B>.
A DbException object contains an informational string and
an errno. The errno can be obtained using
DbException::get_errno(). The informational string can be
obtained using DbException::what().
We expect in the future that this class will inherit from
the standard class exception, but certain language
implementation bugs currently prevent this on some
platforms.
Some methods may return non-zero values without issuing an
exception. This occurs in situations that are not
normally considered an error, but when some informational
status is returned. For example, Db::get returns
DB_KEYNOTFOUND when a requested key does not appear in the
database.
</PRE>
<H2>SEE ALSO</H2><PRE>
<B><A HREF="db_archive.html">db_archive(1)</A></B>, <B><A HREF="db_checkpoint.html">db_checkpoint(1)</A></B>, <B><A HREF="db_deadlock.html">db_deadlock(1)</A></B>, <B><A HREF="db_dump.html">db_dump(1)</A></B>,
<B><A HREF="db_load.html">db_load(1)</A></B>, <B><A HREF="db_recover.html">db_recover(1)</A></B>, <B><A HREF="db_stat.html">db_stat(1)</A></B>, <B><A HREF="db_intro.html">db_intro(3)</A></B>,
<B><A HREF="db_internal.html">db_internal(3)</A></B>, <B><A HREF="db_thread.html">db_thread(3)</A></B>, <B><A HREF="Db.html">Db(3)</A></B>, <B><A HREF="Dbc.html">Dbc(3)</A></B>, <B><A HREF="DbEnv.html">DbEnv(3)</A></B>,
<B><A HREF="DbException.html">DbException(3)</A></B>, <B><A HREF="DbInfo.html">DbInfo(3)</A></B>, <B><A HREF="DbLock.html">DbLock(3)</A></B>, <B><A HREF="DbLockTab.html">DbLockTab(3)</A></B>, <B><A HREF="DbLog.html">DbLog(3)</A></B>,
<B><A HREF="DbLsn.html">DbLsn(3)</A></B>, <B><A HREF="DbMpool.html">DbMpool(3)</A></B>, <B><A HREF="DbMpoolFile.html">DbMpoolFile(3)</A></B>, <B><A HREF="Dbt.html">Dbt(3)</A></B>, <B><A HREF="DbTxn.html">DbTxn(3)</A></B>,
<B><A HREF="DbTxnMgr.html">DbTxnMgr(3)</A></B>
</PRE>
<HR SIZE=1 NOSHADE>
<ADDRESS>
Man(1) output converted with
<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
</ADDRESS>
</BODY>
</HTML>