int Db::cursor(DbTxn *txnid, Dbc **cursorp, u_int32_t flags);
The Db::cursor method creates a cursor and copies a pointer to it into the memory referenced by cursorp.
A cursor is a structure used to provide sequential access through a database. This interface and its associated functions replaces the functionality provided by the seq function in previous releases of Berkeley DB.
If the file is being accessed under transaction protection, the txnid parameter is a transaction ID returned from DbTxnMgr::begin, otherwise, NULL. If transaction protection is enabled, cursors must be opened and closed within the context of a transaction, and the txnid parameter specifies the transaction context in which the cursor may be used.
The flags parameter must be set to 0.
In addition, the following value may be set by logically OR'ing it into the flags parameter:
The Db::cursor method either returns errno or throws an exception that encapsulates an errno on failure, and 0 on success.
The Db::cursor method may fail and throw an exception for any of the errors specified for the following Berkeley DB and C library functions: __ham_c_init(3), free(3), DbLockTab::id, malloc(3), memcpy(3), and memset(3).
In addition, the Db::cursor method may fail and throw an exception or return errno for the following conditions: