diff options
Diffstat (limited to 'db/docs/ref/upgrade.4.1/cxx.html')
-rw-r--r-- | db/docs/ref/upgrade.4.1/cxx.html | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/db/docs/ref/upgrade.4.1/cxx.html b/db/docs/ref/upgrade.4.1/cxx.html new file mode 100644 index 000000000..0e6958823 --- /dev/null +++ b/db/docs/ref/upgrade.4.1/cxx.html @@ -0,0 +1,48 @@ +<!--Id: cxx.so,v 1.3 2002/08/27 02:28:31 bostic Exp --> +<!--Copyright 1997-2002 by Sleepycat Software, Inc.--> +<!--All rights reserved.--> +<!--See the file LICENSE for redistribution information.--> +<html> +<head> +<title>Berkeley DB Reference Guide: Release 4.1: C++ exceptions</title> +<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> +<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,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><h3><dl><dt>Berkeley DB Reference Guide:<dd>Upgrading Berkeley DB Applications</dl></h3></td> +<td align=right><a href="../../ref/upgrade.4.1/java.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/upgrade.4.1/app_dispatch.html"><img src="../../images/next.gif" alt="Next"></a> +</td></tr></table> +<p> +<h1 align=center>Release 4.1: C++ exceptions</h1> +<p>With default flags, the C++ <a href="../../api_cxx/env_class.html">DbEnv</a> and <a href="../../api_cxx/db_class.html">Db</a> classes +can throw exceptions from their constructors. For example, this can +happen if invalid parameters are passed in or the underlying C +structures could not be created. If the objects are created in an +environment that is not configured for exceptions (that is, the +<a href="../../api_c/env_class.html#DB_CXX_NO_EXCEPTIONS">DB_CXX_NO_EXCEPTIONS</a> flag is specified), errors from the +constructor will be returned when the handle's open method is called. +<p>In addition, the behavior of the <a href="../../api_cxx/env_class.html">DbEnv</a> and <a href="../../api_cxx/db_class.html">Db</a> +destructors has changed to simplify exception handling in applications. +The destructors will now close the handle if the handle's close method +was not called prior to the object being destroyed. The return value +of the call is discarded, and no exceptions will be thrown. +Applications should call the close method in normal situations so any +errors while closing can be handled by the application. +<p>This change allows applications to be structured as follows: +<p><blockquote><pre>try { + DbEnv env(0); + env.open(/* ... */); + Db db(&env, 0); + db.open(/* ... */); + /* ... */ + db.close(0); + env.close(0); +} catch (DbException &dbe) { + // Handle the exception, the handles have already been closed. +}</pre></blockquote> +<table width="100%"><tr><td><br></td><td align=right><a href="../../ref/upgrade.4.1/java.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/upgrade.4.1/app_dispatch.html"><img src="../../images/next.gif" alt="Next"></a> +</td></tr></table> +<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font> +</body> +</html> |