curdup.html   [plain text]


<!--$Id: curdup.so,v 11.6 2001/03/01 15:57:49 bostic Exp $-->
<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB Reference Guide: Duplicating a cursor</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
</head>
<body bgcolor=white>
<a name="2"><!--meow--></a><a name="3"><!--meow--></a>
<table width="100%"><tr valign=top>
<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Access Methods</dl></b></td>
<td align=right><a href="../am/curdel.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../am/join.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p align=center><b>Duplicating a cursor</b></p>
<p>Once a cursor has been initialized (for example, by a call to
<a href="../../api_c/dbc_get.html">DBcursor-&gt;get</a>), it can be thought of as identifying a particular
location in a database.  The <a href="../../api_c/dbc_dup.html">DBcursor-&gt;dup</a> method permits an application to
create a new cursor that has the same locking and transactional
information as the cursor from which it is copied, and which optionally
refers to the same position in the database.</p>
<p>In order to maintain a cursor position when an application is using
locking, locks are maintained on behalf of the cursor until the cursor is
closed.  In cases when an application is using locking without
transactions, cursor duplication is often required to avoid
self-deadlocks.  For further details, refer to
<a href="../../ref/lock/am_conv.html">Access method locking conventions</a>.</p>
<table width="100%"><tr><td><br></td><td align=right><a href="../am/curdel.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../am/join.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
</body>
</html>