1<!--$Id: curdup.so,v 11.6 2001/03/01 15:57:49 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: Duplicating a cursor</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<a name="2"><!--meow--></a><a name="3"><!--meow--></a> 12<table width="100%"><tr valign=top> 13<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Access Methods</dl></b></td> 14<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> 15</td></tr></table> 16<p align=center><b>Duplicating a cursor</b></p> 17<p>Once a cursor has been initialized (for example, by a call to 18<a href="/api_c/dbc_get.html">DBcursor->get</a>), it can be thought of as identifying a particular 19location in a database. The <a href="/api_c/dbc_dup.html">DBcursor->dup</a> method permits an application to 20create a new cursor that has the same locking and transactional 21information as the cursor from which it is copied, and which optionally 22refers to the same position in the database.</p> 23<p>In order to maintain a cursor position when an application is using 24locking, locks are maintained on behalf of the cursor until the cursor is 25closed. In cases when an application is using locking without 26transactions, cursor duplication is often required to avoid 27self-deadlocks. For further details, refer to 28<a href="/ref/lock/am_conv.html">Access method locking conventions</a>.</p> 29<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> 30</td></tr></table> 31<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 32</body> 33</html> 34