• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/router/db-4.8.30/docs/programmer_reference/
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml">
4  <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6    <title>Release 4.2: DB_LOCK_NOTGRANTED</title>
7    <link rel="stylesheet" href="gettingStarted.css" type="text/css" />
8    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9    <link rel="start" href="index.html" title="Berkeley DB Programmer's Reference Guide" />
10    <link rel="up" href="upgrade_4_2_toc.html" title="Chapter��39.��Upgrading Berkeley DB 4.1 applications to Berkeley DB 4.2" />
11    <link rel="prev" href="upgrade_4_2_verify.html" title="Release 4.2: DB-&gt;verify" />
12    <link rel="next" href="upgrade_4_2_repinit.html" title="Release 4.2: Replication" />
13  </head>
14  <body>
15    <div class="navheader">
16      <table width="100%" summary="Navigation header">
17        <tr>
18          <th colspan="3" align="center">Release 4.2: DB_LOCK_NOTGRANTED</th>
19        </tr>
20        <tr>
21          <td width="20%" align="left"><a accesskey="p" href="upgrade_4_2_verify.html">Prev</a>��</td>
22          <th width="60%" align="center">Chapter��39.��Upgrading Berkeley DB 4.1 applications to Berkeley DB 4.2</th>
23          <td width="20%" align="right">��<a accesskey="n" href="upgrade_4_2_repinit.html">Next</a></td>
24        </tr>
25      </table>
26      <hr />
27    </div>
28    <div class="sect1" lang="en" xml:lang="en">
29      <div class="titlepage">
30        <div>
31          <div>
32            <h2 class="title" style="clear: both"><a id="upgrade_4_2_lockng"></a>Release 4.2: DB_LOCK_NOTGRANTED</h2>
33          </div>
34        </div>
35      </div>
36      <p>
37    In previous releases, configuring lock or transaction timeout values or calling the <a href="../api_reference/C/txnbegin.html" class="olink">DB_ENV-&gt;txn_begin()</a>
38    method with the <a href="../api_reference/C/txnbegin.html#txnbegin_DB_TXN_NOWAIT" class="olink">DB_TXN_NOWAIT</a> flag caused database operation methods to return 
39    <a class="link" href="program_errorret.html#program_errorret.DB_LOCK_NOTGRANTED">DB_LOCK_NOTGRANTED</a>, 
40    or throw a 
41    <a href="../api_reference/CXX/dblocknotgranted.html" class="olink">DbLockNotGrantedException</a> 
42    exception.  This required applications to unnecessarily handle multiple errors or 
43    exception types.
44</p>
45      <p>
46    In the Berkeley DB 4.2 release, with one exception, database operations will no longer return
47    <a class="link" href="program_errorret.html#program_errorret.DB_LOCK_NOTGRANTED">DB_LOCK_NOTGRANTED</a> or throw a
48    <a href="../api_reference/CXX/dblocknotgranted.html" class="olink">DbLockNotGrantedException</a>
49    exception.  Instead, database operations will return 
50    <a class="link" href="program_errorret.html#program_errorret.DB_LOCK_DEADLOCK">DB_LOCK_DEADLOCK</a> or 
51    throw a <a href="../api_reference/CXX/dbdeadlock.html" class="olink">DbDeadlockException</a>
52    exception.  This change should require no application changes, as applications must 
53    already be dealing with the possible 
54    <a class="link" href="program_errorret.html#program_errorret.DB_LOCK_DEADLOCK">DB_LOCK_DEADLOCK</a> error 
55    return or <a href="../api_reference/CXX/dbdeadlock.html" class="olink">DbDeadlockException</a> 
56    exception from database operations.
57</p>
58      <p>
59    The one exception to this rule is the <a href="../api_reference/C/dbget.html" class="olink">DB-&gt;get()</a> method using the <a href="../api_reference/C/dbget.html#dbget_DB_CONSUME_WAIT" class="olink">DB_CONSUME_WAIT</a> flag to consume records
60    from a Queue.  If lock or transaction timeouts are set, this method and flag combination may
61    return <a class="link" href="program_errorret.html#program_errorret.DB_LOCK_NOTGRANTED">DB_LOCK_NOTGRANTED</a> or
62    throw a 
63    <a href="../api_reference/CXX/dblocknotgranted.html" class="olink">DbLockNotGrantedException</a> 
64    exception.
65</p>
66      <p>
67    Applications wanting to distinguish between true deadlocks and timeouts can configure database
68    operation methods to return 
69    <a class="link" href="program_errorret.html#program_errorret.DB_LOCK_NOTGRANTED">DB_LOCK_NOTGRANTED</a> or 
70    throw a 
71    <a href="../api_reference/CXX/dblocknotgranted.html" class="olink">DbLockNotGrantedException</a> 
72    exception using the <a href="../api_reference/C/envset_flags.html#envset_flags_DB_TIME_NOTGRANTED" class="olink">DB_TIME_NOTGRANTED</a> flag.
73</p>
74      <p>
75    The <a href="../api_reference/C/lockget.html" class="olink">DB_ENV-&gt;lock_get()</a> and <a href="../api_reference/C/lockvec.html" class="olink">DB_ENV-&gt;lock_vec()</a> methods will continue to return 
76    <a class="link" href="program_errorret.html#program_errorret.DB_LOCK_NOTGRANTED">DB_LOCK_NOTGRANTED</a>, or throw a 
77    <a href="../api_reference/CXX/dblocknotgranted.html" class="olink">DbLockNotGrantedException</a> 
78    exception as they have previously done.
79</p>
80    </div>
81    <div class="navfooter">
82      <hr />
83      <table width="100%" summary="Navigation footer">
84        <tr>
85          <td width="40%" align="left"><a accesskey="p" href="upgrade_4_2_verify.html">Prev</a>��</td>
86          <td width="20%" align="center">
87            <a accesskey="u" href="upgrade_4_2_toc.html">Up</a>
88          </td>
89          <td width="40%" align="right">��<a accesskey="n" href="upgrade_4_2_repinit.html">Next</a></td>
90        </tr>
91        <tr>
92          <td width="40%" align="left" valign="top">Release 4.2: DB-&gt;verify��</td>
93          <td width="20%" align="center">
94            <a accesskey="h" href="index.html">Home</a>
95          </td>
96          <td width="40%" align="right" valign="top">��Release 4.2: Replication</td>
97        </tr>
98      </table>
99    </div>
100  </body>
101</html>
102