DBcursor->c_dup
|
|
#include <db.h>
int
DBcursor->c_dup(DBC *DBcursor, DBC **cursorp, u_int32_t flags);
Description: DBcursor->c_dup
The DBcursor->c_dup method creates a new cursor that uses the same transaction
and locker ID as the original cursor. This is useful when an application
is using locking and requires two or more cursors in the same thread of
control.
The DBcursor->c_dup method
returns a non-zero error value on failure
and 0 on success.
Parameters
- flags
-
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one
or more of the following values:
- DB_POSITION
- The newly created cursor is initialized to refer to the same position
in the database as the original cursor and hold the same locks. If the
DB_POSITION flag is not specified, then the created cursor is
uninitialized and will behave like a cursor newly created using
DB->cursor.
Errors
The DBcursor->c_dup method
may fail and return one of the following non-zero errors:
- DB_REP_HANDLE_DEAD
- The database handle has been invalidated because a replication election
unrolled a committed transaction.
- EINVAL
- If the cursor has not been initialized; or if an
invalid flag value or parameter was specified.
Class
DBC
See Also
Database Cursors and Related Methods
Copyright (c) 1996-2003 Sleepycat Software, Inc. - All rights reserved.