• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/timemachine/db-4.7.25.NC/docs/ref/upgrade.4.3/
1<!--$Id: enomem.so,v 1.2 2004/09/28 14:13:09 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 Reference Guide: Release 4.3: ENOMEM and DbMemoryException</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><b><dl><dt>Berkeley DB Reference Guide:<dd>Upgrading Berkeley DB Applications</dl></b></td>
13<td align=right><a href="../upgrade.4.3/fileopen.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../upgrade.4.3/repl.html"><img src="../../images/next.gif" alt="Next"></a>
14</td></tr></table>
15<p align=center><b>Release 4.3: ENOMEM and DbMemoryException</b></p>
16<p>In versions of Berkeley DB before 4.3, the error <b>ENOMEM</b> was used to
17indicate that the buffer in a <a href="../../api_c/dbt_class.html">DBT</a> configured with
18<a href="../../api_c/dbt_class.html#DB_DBT_USERMEM">DB_DBT_USERMEM</a> was too small to hold a key or data item being
19retrieved.  The 4.3 release adds a new error, <a href="../../api_c/dbt_class.html#DB_BUFFER_SMALL">DB_BUFFER_SMALL</a>,
20that is returned in this case.</p>
21<p>The reason for the change is that the use of <b>ENOMEM</b> was
22ambiguous: calls such as <a href="../../api_c/db_get.html">DB-&gt;get</a> or <a href="../../api_c/dbc_get.html">DBcursor-&gt;get</a> could return
23<b>ENOMEM</b> either if a <a href="../../api_c/dbt_class.html">DBT</a> was too small or if some resource
24was exhausted.</p>
25<p>The result is that starting with the 4.3 release, C applications should
26always treat <b>ENOMEM</b> as a fatal error.  Code that checked for
27the <b>ENOMEM</b> return and allocated a new buffer should be changed
28to check for <a href="../../api_c/dbt_class.html#DB_BUFFER_SMALL">DB_BUFFER_SMALL</a>.</p>
29<p>In C++ applications configured for exceptions, a
30<a href="../../api_cxx/memp_class.html">DbMemoryException</a> will continue to be thrown in both cases,
31and applications should check the errno in the exception to determine
32which error occurred.</p>
33<p>In Java applications, a <b>DbMemoryException</b> will be thrown
34when a <b>Dbt</b> is too small to hold a return value, and an
35<b>OutOfMemoryError</b> will be thrown in all cases of resource
36exhaustion.</p>
37<table width="100%"><tr><td><br></td><td align=right><a href="../upgrade.4.3/fileopen.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../upgrade.4.3/repl.html"><img src="../../images/next.gif" alt="Next"></a>
38</td></tr></table>
39<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
40</body>
41</html>
42