• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src/router/db-4.8.30/docs/api_reference/CXX/
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>DbLockNotGrantedException</title>
7    <link rel="stylesheet" href="apiReference.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 C++ API Reference" />
10    <link rel="up" href="dbexception.html" title="Chapter 6. The DbException Class" />
11    <link rel="prev" href="dbdeadlock.html" title="DbDeadlockException" />
12    <link rel="next" href="dbmemory.html" title="DbMemoryException" />
13  </head>
14  <body>
15    <div class="navheader">
16      <table width="100%" summary="Navigation header">
17        <tr>
18          <th colspan="3" align="center">DbLockNotGrantedException</th>
19        </tr>
20        <tr>
21          <td width="20%" align="left"><a accesskey="p" href="dbdeadlock.html">Prev</a> </td>
22          <th width="60%" align="center">Chapter 6. The DbException Class</th>
23          <td width="20%" align="right"> <a accesskey="n" href="dbmemory.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="dblocknotgranted"></a>DbLockNotGrantedException</h2>
33          </div>
34        </div>
35      </div>
36      <pre class="programlisting">#include &lt;db_cxx.h&gt;
37
38class DbLockNotGrantedException : public DbException {
39public:
40    db_lockop_t get_op() const;
41    db_lockmode_t get_mode() const;
42    const Dbt* get_obj() const;
43    DbLock *get_lock() const;
44    int get_index() const;
45}; </pre>
46      <p>
47        This information describes the <code class="classname">DbLockNotGrantedException</code> class and how 
48        it is used by the various Berkeley DB classes.
49    </p>
50      <p>
51        A <code class="classname">DbLockNotGrantedException</code> is thrown when
52        lock or transaction timeouts have been configured, a database operation has timed out, and the
53        <a class="link" href="envset_flags.html#envset_flags_DB_TIME_NOTGRANTED">DB_TIME_NOTGRANTED</a> 
54        configuration flag has been specified.
55    </p>
56      <p>
57        Additionally <code class="classname">DbLockNotGrantedException</code> is thrown when a Berkeley DB
58        Concurrent Data Store database environment configured for lock timeouts was unable to grant
59        a lock in the allowed time.
60    </p>
61      <p>
62        Finally, <code class="classname">DbLockNotGrantedException</code> is thrown when a lock requested using the
63        <a class="xref" href="lockget.html" title="DbEnv::lock_get()">DbEnv::lock_get()</a>
64        or
65        <a class="xref" href="lockvec.html" title="DbEnv::lock_vec()">DbEnv::lock_vec()</a>
66        methods, where the <a class="link" href="lockvec.html#vec_DB_LOCK_NOWAIT">DB_LOCK_NOWAIT</a>
67        flag or lock timers were configured, could not be granted before the wait-time expired.
68    </p>
69      <p>
70        The <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> errno value is set to
71        <code class="literal">DB_LOCK_NOTGRANTED</code>.
72    </p>
73      <p>
74        The following getter methods are available on this class:
75    </p>
76      <div class="itemizedlist">
77        <ul type="disc">
78          <li>
79            <p>
80                <code class="methodname">get_op()</code>
81            </p>
82            <p>
83                Returns <code class="literal">DB_LOCK_GET</code> when <a class="xref" href="lockget.html" title="DbEnv::lock_get()">DbEnv::lock_get()</a>
84                was called, and returns the <span class="bold"><strong>op</strong></span> for the failed
85                <code class="literal">DB_LOCKREQ</code> when <a class="xref" href="lockvec.html" title="DbEnv::lock_vec()">DbEnv::lock_vec()</a>
86                was called. If this exception is raised due to a database
87                operation, <code class="literal">DB_LOCK_GET</code> is returned.
88            </p>
89          </li>
90          <li>
91            <p>
92                <code class="methodname">get_mode()</code>
93            </p>
94            <p>
95                Returns the <span class="bold"><strong>mode</strong></span> parameter when 
96                <a class="xref" href="lockget.html" title="DbEnv::lock_get()">DbEnv::lock_get()</a> was called, and returns the
97                <span class="bold"><strong>mode</strong></span> for the failed <code class="literal">DB_LOCKREQ</code>
98                when <a class="xref" href="lockvec.html" title="DbEnv::lock_vec()">DbEnv::lock_vec()</a> was called.
99                If this exception is raised due to a database operation, 
100                <code class="literal">DB_LOCK_NG</code> is returned.
101            </p>
102          </li>
103          <li>
104            <p>
105                <code class="methodname">get_obj()</code>
106            </p>
107            <p>
108                Returns the <span class="bold"><strong>object</strong></span> parameter when 
109                <a class="xref" href="lockget.html" title="DbEnv::lock_get()">DbEnv::lock_get()</a> was called, and returns the
110                <span class="bold"><strong>object</strong></span> for the failed <code class="literal">DB_LOCKREQ</code>
111                when <a class="xref" href="lockvec.html" title="DbEnv::lock_vec()">DbEnv::lock_vec()</a> was called.
112                The <a class="link" href="dbt.html" title="Chapter 4.  The Dbt Handle">Dbt</a> pointer may or may not refer valid
113                memory, depending on whether the <a class="link" href="dbt.html" title="Chapter 4.  The Dbt Handle">Dbt</a>
114                used in the call to the failed <a class="xref" href="lockget.html" title="DbEnv::lock_get()">DbEnv::lock_get()</a>
115                or <a class="xref" href="lockvec.html" title="DbEnv::lock_vec()">DbEnv::lock_vec()</a> method is still in
116                scope and has not been deleted.
117            </p>
118          </li>
119          <li>
120            <p>
121                <code class="methodname">get_lock()</code>
122            </p>
123            <p>
124                Returns NULL when <a class="xref" href="lockget.html" title="DbEnv::lock_get()">DbEnv::lock_get()</a> was called, 
125                and returns the <span class="bold"><strong>lock</strong></span> in the failed <code class="literal">DB_LOCKREQ</code>
126                when <a class="xref" href="lockvec.html" title="DbEnv::lock_vec()">DbEnv::lock_vec()</a> was called.
127                If this exception is raised due to a database operation, NULL is returned.
128            </p>
129          </li>
130          <li>
131            <p>
132                <code class="methodname">get_index()</code>
133            </p>
134            <p>
135                Returns <code class="literal">-1</code> when <a class="xref" href="lockget.html" title="DbEnv::lock_get()">DbEnv::lock_get()</a> was called, 
136                and returns the index of the failed <code class="literal">DB_LOCKREQ</code>
137                when <a class="xref" href="lockvec.html" title="DbEnv::lock_vec()">DbEnv::lock_vec()</a> was called.
138                If this exception is raised due to a database operation, 
139                <code class="literal">0</code> is returned.
140            </p>
141          </li>
142        </ul>
143      </div>
144    </div>
145    <div class="navfooter">
146      <hr />
147      <table width="100%" summary="Navigation footer">
148        <tr>
149          <td width="40%" align="left"><a accesskey="p" href="dbdeadlock.html">Prev</a> </td>
150          <td width="20%" align="center">
151            <a accesskey="u" href="dbexception.html">Up</a>
152          </td>
153          <td width="40%" align="right"> <a accesskey="n" href="dbmemory.html">Next</a></td>
154        </tr>
155        <tr>
156          <td width="40%" align="left" valign="top">DbDeadlockException </td>
157          <td width="20%" align="center">
158            <a accesskey="h" href="index.html">Home</a>
159          </td>
160          <td width="40%" align="right" valign="top"> DbMemoryException</td>
161        </tr>
162      </table>
163    </div>
164  </body>
165</html>
166