/* * ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version: 1.3.19 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.sleepycat.db; /** * The Dbc object is the handle for a cursor into a Berkeley DB * database. The handle is not free-threaded. Cursor handles may be * used by multiple threads, but only serially, that is, the * application must serialize access to the Dbc handle.
* * If the cursor is to be used to perform operations on behalf of a * transaction, the cursor must be opened and closed within the * context of that single transaction. Once {@link * com.sleepycat.db.Dbc#close Dbc.close} has been called, the handle * may not be accessed again, regardless of the method's return.
*/ public class Dbc { private long swigCPtr; protected boolean swigCMemOwn; protected Dbc(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } protected Dbc() { this(0, false); } protected void delete() { if (swigCPtr != 0 && swigCMemOwn) { swigCMemOwn = false; } swigCPtr = 0; } protected static long getCPtr(Dbc obj) { return (obj == null) ? 0 : obj.swigCPtr; } /** * The Dbc.close method discards the cursor.* * It is possible for the Dbc.close method to return * Db.DB_LOCK_DEADLOCK , signaling that any enclosing * transaction should be aborted. If the application is already * intending to abort the transaction, this error should be * ignored, and the application should proceed.
* * After Dbc.close has been called, regardless of its return, the * cursor handle may not be used again.
* * @throws DbDeadlockException If a transactional database * environment operation was selected to resolve a deadlock, * the Dbc.close method will fail and throw a {@link * com.sleepycat.db.DbDeadlockException DbDeadlockException} * exception. * @throws DbLockNotGrantedException If a Berkeley DB Concurrent * Data Store database environment configured for lock * timeouts was unable to grant a lock in the allowed time, * the Dbc.close method will fail and throw a {@link * com.sleepycat.db.DbLockNotGrantedException * DbLockNotGrantedException} exception. * @throws IllegalArgumentException The Dbc.close method will * fail and throw a IllegalArgumentException exception if the * cursor is already closed; or if an invalid flag value or * parameter was specified. */ public synchronized void close() throws DbException { try { close0(); } finally { swigCPtr = 0; } } /** * @deprecated Replaced in Berkeley DB 4.2 by {@link * #get(Dbt,Dbt,Dbt,int)} */ public int pget(Dbt key, Dbt pkey, Dbt data, int flags) throws DbException { return get(key, pkey, data, flags); } void close0() { db_javaJNI.Dbc_close0(swigCPtr); } /** * The Dbc.count method returns a count of the number of data * items for the key to which the cursor refers. * * @param flags currently unused, and must * be set to 0. * @throws DbException The Dbc.count method may * fail and throw {@link com.sleepycat.db.DbException * DbException}, encapsulating one of the following non-zero * errors: * @throws IllegalArgumentException The Dbc.count method will * fail and throw a IllegalArgumentException exception if the * cursor has not been initialized; or if an invalid flag * value or parameter was specified. * @return The Dbc.count method throws * an exception that encapsulates a non-zero error value on * failure. */ public int count(int flags) throws DbException { return db_javaJNI.Dbc_count(swigCPtr, flags); } /** * @deprecated As of Berkeley DB 4.2, replaced by {@link * #delete(int)} */ public int del(int flags) throws DbException { return delete(flags); } /** * The Dbc.delete method deletes the key/data pair to which the * cursor refers.* * When called on a cursor opened on a database that has been * made into a secondary index using the {@link * com.sleepycat.db.Db#associate Db.associate} method, the {@link * com.sleepycat.db.Db#delete Db.delete} method deletes the * key/data pair from the primary database and all secondary * indices.
* * The cursor position is unchanged after a delete, and * subsequent calls to cursor functions expecting the cursor to * refer to an existing key will fail.
* * @param flags currently unused, and must * be set to 0. * @throws DbException The Dbc.delete method may * fail and throw {@link com.sleepycat.db.DbException * DbException}, encapsulating one of the following non-zero * errors: An attempt was made to modify a read-only * database. *
*
* The Dbc.delete method will return
* Db.DB_KEYEMPTY if the element has
* already been deleted.
*
* 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.DB_POSITION
* flag is not specified, then the created cursor is
* uninitialized and will behave like a cursor newly
* created using {@link com.sleepycat.db.Db#cursor
* Db.cursor}.
* * When called on a cursor opened on a database that has been * made into a secondary index using the {@link * com.sleepycat.db.Db#associate Db.associate} method, the * Dbc.get and Dbc.get methods return the key from the secondary * index and the data item from the primary database. In * addition, the second method signature returns the key from the * primary database. In databases that are not secondary indices, * the second method signature will always fail.
* * Modifications to the database during a sequential scan will be * reflected in the scan; that is, records inserted behind a * cursor will not be returned while records inserted in front of * a cursor will be returned.
* * In Queue and Recno databases, missing entries (that is, * entries that were never explicitly created or that were * created and then deleted) will be skipped during a sequential * scan.
If Dbc.get fails for any reason, the state of the * cursor will be unchanged. * * @param data The data {@link * com.sleepycat.db.Dbt Dbt} operated on. * @param flags must be set to one of the * following values: ** * Return the key/data pair to which the cursor refers. *
* * The cursor is set to refer to the first key/data pair of * the database, and that pair is returned. If the first * key has duplicate values, the first data item in the set * of duplicates is returned.
*
* If the database is a Queue or Recno database, Dbc.get
* using the Db.DB_FIRST flag will ignore any
* keys that exist but were never explicitly created by the
* application, or were created and later deleted.
*
* The Db.DB_GET_BOTH flag is identical to the
* Db.DB_SET flag, except that both the key
* and the data parameters must be matched by the key and
* data item in the database.
*
* When used with the second method signature version of
* this method on a secondary index handle, both the
* secondary and primary keys must be matched by the
* secondary and primary key item in the database. It is an
* error to use the Db.DB_GET_BOTH flag with
* the first method signature version of this method and a
* cursor that has been opened on a secondary index handle.
*
*
* The Db.DB_GET_BOTH_RANGE flag is identical
* to the Db.DB_GET_BOTH flag, except that, in
* the case of any database supporting sorted duplicate
* sets, the returned key/data pair is the smallest data
* item greater than or equal to the specified data item
* (as determined by the comparison function), permitting
* partial matches and range searches in duplicate data
* sets.
* * Return the record number associated with the cursor. The * record number will be returned in data , as * described in {@link com.sleepycat.db.Dbt Dbt}. ignored. *
*
* For Db.DB_GET_RECNO to be specified, the
* underlying database must be of type Btree, and it must
* have been created with the {@link
* com.sleepycat.db.Db#DB_RECNUM Db.DB_RECNUM}
* flag.
*
* When called on a cursor opened on a database that has
* been made into a secondary index, the Dbc.get method
* returns the record number of the primary database in
* data . In addition, the second method signature
* returns the record number of the secondary index in
* pkey . If either underlying database is not of type
* Btree or is not created with the {@link
* com.sleepycat.db.Db#DB_RECNUM Db.DB_RECNUM}
* flag, the out-of-band record number of 0 is returned.
*
* * Do not use the data value found in all of the cursors as * a lookup key for the primary database, but simply return * it in the key parameter instead. The data parameter is * left unchanged.
*
* For Db.DB_JOIN_ITEM to be specified, the
* underlying cursor must have been returned from the
* {@link com.sleepycat.db.Db#join Db.join} method.
* * The cursor is set to refer to the last key/data pair of * the database, and that pair is returned. If the last key * has duplicate values, the last data item in the set of * duplicates is returned.
*
* If the database is a Queue or Recno database, Dbc.get
* using the Db.DB_LAST flag will ignore any
* keys that exist but were never explicitly created by the
* application, or were created and later deleted.
*
* If the cursor is not yet initialized, Db.DB_NEXT
* is identical to Db.DB_FIRST. Otherwise, the
* cursor is moved to the next key/data pair of the
* database, and that pair is returned. In the presence of
* duplicate key values, the value of the key may not
* change.
*
* If the database is a Queue or Recno database, Dbc.get
* using the Db.DB_NEXT flag will skip any
* keys that exist but were never explicitly created by the
* application, or those that were created and later
* deleted.
* * If the next key/data pair of the database is a duplicate * data record for the current key/data pair, the cursor is * moved to the next key/data pair of the database, and * that pair is returned.
*
* If the cursor is not yet initialized, Db.DB_NEXT_NODUP
* is identical to Db.DB_FIRST. Otherwise, the
* cursor is moved to the next non-duplicate key of the
* database, and that key/data pair is returned.
*
* If the database is a Queue or Recno database, Dbc.get
* using the Db.DB_NEXT_NODUP flag will ignore
* any keys that exist but were never explicitly created by
* the application, or those that were created and later
* deleted.
*
* If the cursor is not yet initialized, Db.DB_PREV
* is identical to Db.DB_LAST. Otherwise, the
* cursor is moved to the previous key/data pair of the
* database, and that pair is returned. In the presence of
* duplicate key values, the value of the key may not
* change.
*
* If the database is a Queue or Recno database, Dbc.get
* using the Db.DB_PREV flag will skip any
* keys that exist but were never explicitly created by the
* application, or those that were created and later
* deleted.
*
* If the cursor is not yet initialized, Db.DB_PREV_NODUP
* is identical to Db.DB_LAST. Otherwise, the
* cursor is moved to the previous non-duplicate key of the
* database, and that key/data pair is returned.
*
* If the database is a Queue or Recno database, Dbc.get
* using the Db.DB_PREV_NODUP flag will ignore
* any keys that exist but were never explicitly created by
* the application, or those that were created and later
* deleted.
* * Move the cursor to the specified key/data pair of the * database, and return the datum associated with the given * key.
*
* The Db.DB_SET_RANGE flag is identical to
* the Db.DB_SET flag, except that in the case
* of the Btree access method, the key is returned as well
* as the data item and the returned key/data pair is the
* smallest key greater than or equal to the specified key
* (as determined by the Btree comparison function),
* permitting partial key matches and range searches.
* * Move the cursor to the specific numbered record of the * database, and return the associated key/data pair. The * data field of the specified key must be a * byte array containing a record number, as described in * {@link com.sleepycat.db.Dbt Dbt}. This determines the * record to be retrieved.
*
* For Db.DB_SET_RECNO to be specified, the
* underlying database must be of type Btree, and it must
* have been created with the {@link
* com.sleepycat.db.Db#DB_RECNUM Db.DB_RECNUM}
* flag.
*
* Read modified but not yet committed data. Silently
* ignored if the {@link com.sleepycat.db.Db#DB_DIRTY_READ
* Db.DB_DIRTY_READ} flag was not specified
* when the underlying database was opened.
* * Return multiple data items in the data parameter. *
*
* In the case of Btree or Hash databases, duplicate data
* items for the current key, starting at the current
* cursor position, are entered into the buffer. Subsequent
* calls with both the Db.DB_NEXT_DUP and
* Db.DB_MULTIPLE flags specified will return
* additional duplicate data items associated with the
* current key or
* Db.DB_NOTFOUND if there are no
* additional duplicate data items to return. Subsequent
* calls with both the Db.DB_NEXT and Db.DB_MULTIPLE
* flags specified will return additional duplicate data
* items associated with the current key or if there are no
* additional duplicate data items will return the next key
* and its data items or
* Db.DB_NOTFOUND if there are no
* additional keys in the database.
*
* In the case of Queue or Recno databases, data items
* starting at the current cursor position are entered into
* the buffer. The record number of the first record will
* be returned in the key parameter. The record
* number of each subsequent returned record must be
* calculated from this value. Subsequent calls with the
* Db.DB_MULTIPLE flag specified will return
* additional data items or
* Db.DB_NOTFOUND if there are no
* additional data items to return.
*
* The buffer to which the data parameter refers
* must be provided from user memory (see {@link
* com.sleepycat.db.Db#DB_DBT_USERMEM Db.DB_DBT_USERMEM
* }). The buffer must be at least as large as the page
* size of the underlying database, aligned for unsigned
* integer access, and be a multiple of 1024 bytes in size.
* If the buffer size is insufficient, then upon return
* from the call the size field of the data
* parameter will have been set to an estimated buffer
* size, and a {@link com.sleepycat.db.DbMemoryException
* DbMemoryException} is thrown. (The size is an estimate
* as the exact size needed may not be known until all
* entries are read. It is best to initially provide a
* relatively large buffer, but applications should be
* prepared to resize the buffer as necessary and
* repeatedly call the method.)
* * The multiple data items can be iterated over using the * {@link com.sleepycat.db.DbMultipleDataIterator * DbMultipleDataIterator} class.
*
* The Db.DB_MULTIPLE flag may only be used
* with the Db.DB_CURRENT, Db.DB_FIRST
* , Db.DB_GET_BOTH, Db.DB_GET_BOTH_RANGE
* , Db.DB_NEXT, Db.DB_NEXT_DUP,
* Db.DB_NEXT_NODUP, Db.DB_SET,
* Db.DB_SET_RANGE, and Db.DB_SET_RECNO
* options. The Db.DB_MULTIPLE flag may not be
* used when accessing databases made into secondary
* indices using the {@link com.sleepycat.db.Db#associate
* Db.associate} method.
* * Return multiple key and data pairs in the data * parameter.
*
* Key and data pairs, starting at the current cursor
* position, are entered into the buffer. Subsequent calls
* with both the Db.DB_NEXT and Db.DB_MULTIPLE
* flags specified will return additional key and data
* pairs or
* Db.DB_NOTFOUND if there are no
* additional key and data items to return.
* * In the case of Btree or Hash databases, the multiple key * and data pairs can be iterated over using the {@link * com.sleepycat.db.DbMultipleKeyDataIterator * DbMultipleKeyDataIterator} class.
* * In the case of Queue or Recno databases, the multiple * record number and data pairs can be iterated over using * the {@link com.sleepycat.db.DbMultipleRecnoDataIterator * DbMultipleRecnoDataIterator} class.
*
* The buffer to which the data parameter refers
* must be provided from user memory (see {@link
* com.sleepycat.db.Db#DB_DBT_USERMEM Db.DB_DBT_USERMEM
* }). The buffer must be at least as large as the page
* size of the underlying database, aligned for unsigned
* integer access, and be a multiple of 1024 bytes in size.
* If the buffer size is insufficient, then upon return
* from the call the size field of the data
* parameter will have been set to an estimated buffer
* size, and a {@link com.sleepycat.db.DbMemoryException
* DbMemoryException} is thrown. (The size is an estimate
* as the exact size needed may not be known until all
* entries are read. It is best to initially provide a
* relatively large buffer, but applications should be
* prepared to resize the buffer as necessary and
* repeatedly call the method.)
*
* The Db.DB_MULTIPLE_KEY flag may only be
* used with the Db.DB_CURRENT, Db.DB_FIRST
* , Db.DB_GET_BOTH, Db.DB_GET_BOTH_RANGE
* , Db.DB_NEXT, Db.DB_NEXT_DUP,
* Db.DB_NEXT_NODUP, Db.DB_SET,
* Db.DB_SET_RANGE, and Db.DB_SET_RECNO
* options. The Db.DB_MULTIPLE_KEY flag may
* not be used when accessing databases made into secondary
* indices using the {@link com.sleepycat.db.Db#associate
* Db.associate} method.
* * Acquire write locks instead of read locks when doing the * retrieval. Setting this flag can eliminate deadlock * during a read-modify-write cycle by acquiring the write * lock during the read part of the cycle so that another * thread of control acquiring a read lock for the same * item, in its own read-modify-write cycle, will not * result in deadlock.
*
* The Dbc.get method will return
* Db.DB_KEYEMPTY if Db.DB_CURRENT
* is set and the cursor key/data pair was deleted.
*
* The Dbc.get method will return
* Db.DB_NOTFOUND if Db.DB_FIRST
* is set and the database is empty.
*
* The Dbc.get method will return
* Db.DB_NOTFOUND if Db.DB_LAST
* is set and the database is empty.
*
* The Dbc.get method will return
* Db.DB_NOTFOUND if Db.DB_NEXT
* is set and the cursor is already on the last record in
* the database.
*
* The Dbc.get method will return
* Db.DB_NOTFOUND if Db.DB_NEXT_DUP
* is set and the next key/data pair of the database is not
* a duplicate data record for the current key/data pair.
*
*
* The Dbc.get method will return
* Db.DB_NOTFOUND if Db.DB_NEXT_NODUP
* is set and no non-duplicate key/data pairs occur after
* the cursor position in the database.
*
* The Dbc.get method will return
* Db.DB_NOTFOUND if Db.DB_PREV
* is set and the cursor is already on the first record in
* the database.
*
* The Dbc.get method will return
* Db.DB_NOTFOUND if Db.DB_PREV_NODUP
* is set and no non-duplicate key/data pairs occur before
* the cursor position in the database.
*
* The Dbc.get method will return
* Db.DB_NOTFOUND if Db.DB_SET
* is set and no matching keys are found.
*
* The Dbc.get method will return
* Db.DB_KEYEMPTY if Db.DB_SET
* is set and the database is a Queue or Recno database,
* and the specified key exists, but was never explicitly
* created by the application or was later deleted.
* * When called on a cursor opened on a database that has been * made into a secondary index using the {@link * com.sleepycat.db.Db#associate Db.associate} method, the * Dbc.get and Dbc.get methods return the key from the secondary * index and the data item from the primary database. In * addition, the second method signature returns the key from the * primary database. In databases that are not secondary indices, * the second method signature will always fail.
* * Modifications to the database during a sequential scan will be * reflected in the scan; that is, records inserted behind a * cursor will not be returned while records inserted in front of * a cursor will be returned.
* * In Queue and Recno databases, missing entries (that is, * entries that were never explicitly created or that were * created and then deleted) will be skipped during a sequential * scan.
If Dbc.get fails for any reason, the state of the * cursor will be unchanged. * * @param data The data {@link * com.sleepycat.db.Dbt Dbt} operated on. * @param flags must be set to one of the * following values: ** * Return the key/data pair to which the cursor refers. *
* * The cursor is set to refer to the first key/data pair of * the database, and that pair is returned. If the first * key has duplicate values, the first data item in the set * of duplicates is returned.
*
* If the database is a Queue or Recno database, Dbc.get
* using the Db.DB_FIRST flag will ignore any
* keys that exist but were never explicitly created by the
* application, or were created and later deleted.
*
* The Db.DB_GET_BOTH flag is identical to the
* Db.DB_SET flag, except that both the key
* and the data parameters must be matched by the key and
* data item in the database.
*
* When used with the second method signature version of
* this method on a secondary index handle, both the
* secondary and primary keys must be matched by the
* secondary and primary key item in the database. It is an
* error to use the Db.DB_GET_BOTH flag with
* the first method signature version of this method and a
* cursor that has been opened on a secondary index handle.
*
*
* The Db.DB_GET_BOTH_RANGE flag is identical
* to the Db.DB_GET_BOTH flag, except that, in
* the case of any database supporting sorted duplicate
* sets, the returned key/data pair is the smallest data
* item greater than or equal to the specified data item
* (as determined by the comparison function), permitting
* partial matches and range searches in duplicate data
* sets.
* * Return the record number associated with the cursor. The * record number will be returned in data , as * described in {@link com.sleepycat.db.Dbt Dbt}. ignored. *
*
* For Db.DB_GET_RECNO to be specified, the
* underlying database must be of type Btree, and it must
* have been created with the {@link
* com.sleepycat.db.Db#DB_RECNUM Db.DB_RECNUM}
* flag.
*
* When called on a cursor opened on a database that has
* been made into a secondary index, the Dbc.get method
* returns the record number of the primary database in
* data . In addition, the second method signature
* returns the record number of the secondary index in
* pkey . If either underlying database is not of type
* Btree or is not created with the {@link
* com.sleepycat.db.Db#DB_RECNUM Db.DB_RECNUM}
* flag, the out-of-band record number of 0 is returned.
*
* * Do not use the data value found in all of the cursors as * a lookup key for the primary database, but simply return * it in the key parameter instead. The data parameter is * left unchanged.
*
* For Db.DB_JOIN_ITEM to be specified, the
* underlying cursor must have been returned from the
* {@link com.sleepycat.db.Db#join Db.join} method.
* * The cursor is set to refer to the last key/data pair of * the database, and that pair is returned. If the last key * has duplicate values, the last data item in the set of * duplicates is returned.
*
* If the database is a Queue or Recno database, Dbc.get
* using the Db.DB_LAST flag will ignore any
* keys that exist but were never explicitly created by the
* application, or were created and later deleted.
*
* If the cursor is not yet initialized, Db.DB_NEXT
* is identical to Db.DB_FIRST. Otherwise, the
* cursor is moved to the next key/data pair of the
* database, and that pair is returned. In the presence of
* duplicate key values, the value of the key may not
* change.
*
* If the database is a Queue or Recno database, Dbc.get
* using the Db.DB_NEXT flag will skip any
* keys that exist but were never explicitly created by the
* application, or those that were created and later
* deleted.
* * If the next key/data pair of the database is a duplicate * data record for the current key/data pair, the cursor is * moved to the next key/data pair of the database, and * that pair is returned.
*
* If the cursor is not yet initialized, Db.DB_NEXT_NODUP
* is identical to Db.DB_FIRST. Otherwise, the
* cursor is moved to the next non-duplicate key of the
* database, and that key/data pair is returned.
*
* If the database is a Queue or Recno database, Dbc.get
* using the Db.DB_NEXT_NODUP flag will ignore
* any keys that exist but were never explicitly created by
* the application, or those that were created and later
* deleted.
*
* If the cursor is not yet initialized, Db.DB_PREV
* is identical to Db.DB_LAST. Otherwise, the
* cursor is moved to the previous key/data pair of the
* database, and that pair is returned. In the presence of
* duplicate key values, the value of the key may not
* change.
*
* If the database is a Queue or Recno database, Dbc.get
* using the Db.DB_PREV flag will skip any
* keys that exist but were never explicitly created by the
* application, or those that were created and later
* deleted.
*
* If the cursor is not yet initialized, Db.DB_PREV_NODUP
* is identical to Db.DB_LAST. Otherwise, the
* cursor is moved to the previous non-duplicate key of the
* database, and that key/data pair is returned.
*
* If the database is a Queue or Recno database, Dbc.get
* using the Db.DB_PREV_NODUP flag will ignore
* any keys that exist but were never explicitly created by
* the application, or those that were created and later
* deleted.
* * Move the cursor to the specified key/data pair of the * database, and return the datum associated with the given * key.
*
* The Db.DB_SET_RANGE flag is identical to
* the Db.DB_SET flag, except that in the case
* of the Btree access method, the key is returned as well
* as the data item and the returned key/data pair is the
* smallest key greater than or equal to the specified key
* (as determined by the Btree comparison function),
* permitting partial key matches and range searches.
* * Move the cursor to the specific numbered record of the * database, and return the associated key/data pair. The * data field of the specified key must be a * byte array containing a record number, as described in * {@link com.sleepycat.db.Dbt Dbt}. This determines the * record to be retrieved.
*
* For Db.DB_SET_RECNO to be specified, the
* underlying database must be of type Btree, and it must
* have been created with the {@link
* com.sleepycat.db.Db#DB_RECNUM Db.DB_RECNUM}
* flag.
*
* Read modified but not yet committed data. Silently
* ignored if the {@link com.sleepycat.db.Db#DB_DIRTY_READ
* Db.DB_DIRTY_READ} flag was not specified
* when the underlying database was opened.
* * Return multiple data items in the data parameter. *
*
* In the case of Btree or Hash databases, duplicate data
* items for the current key, starting at the current
* cursor position, are entered into the buffer. Subsequent
* calls with both the Db.DB_NEXT_DUP and
* Db.DB_MULTIPLE flags specified will return
* additional duplicate data items associated with the
* current key or
* Db.DB_NOTFOUND if there are no
* additional duplicate data items to return. Subsequent
* calls with both the Db.DB_NEXT and Db.DB_MULTIPLE
* flags specified will return additional duplicate data
* items associated with the current key or if there are no
* additional duplicate data items will return the next key
* and its data items or
* Db.DB_NOTFOUND if there are no
* additional keys in the database.
*
* In the case of Queue or Recno databases, data items
* starting at the current cursor position are entered into
* the buffer. The record number of the first record will
* be returned in the key parameter. The record
* number of each subsequent returned record must be
* calculated from this value. Subsequent calls with the
* Db.DB_MULTIPLE flag specified will return
* additional data items or
* Db.DB_NOTFOUND if there are no
* additional data items to return.
*
* The buffer to which the data parameter refers
* must be provided from user memory (see {@link
* com.sleepycat.db.Db#DB_DBT_USERMEM Db.DB_DBT_USERMEM
* }). The buffer must be at least as large as the page
* size of the underlying database, aligned for unsigned
* integer access, and be a multiple of 1024 bytes in size.
* If the buffer size is insufficient, then upon return
* from the call the size field of the data
* parameter will have been set to an estimated buffer
* size, and a {@link com.sleepycat.db.DbMemoryException
* DbMemoryException} is thrown. (The size is an estimate
* as the exact size needed may not be known until all
* entries are read. It is best to initially provide a
* relatively large buffer, but applications should be
* prepared to resize the buffer as necessary and
* repeatedly call the method.)
* * The multiple data items can be iterated over using the * {@link com.sleepycat.db.DbMultipleDataIterator * DbMultipleDataIterator} class.
*
* The Db.DB_MULTIPLE flag may only be used
* with the Db.DB_CURRENT, Db.DB_FIRST
* , Db.DB_GET_BOTH, Db.DB_GET_BOTH_RANGE
* , Db.DB_NEXT, Db.DB_NEXT_DUP,
* Db.DB_NEXT_NODUP, Db.DB_SET,
* Db.DB_SET_RANGE, and Db.DB_SET_RECNO
* options. The Db.DB_MULTIPLE flag may not be
* used when accessing databases made into secondary
* indices using the {@link com.sleepycat.db.Db#associate
* Db.associate} method.
* * Return multiple key and data pairs in the data * parameter.
*
* Key and data pairs, starting at the current cursor
* position, are entered into the buffer. Subsequent calls
* with both the Db.DB_NEXT and Db.DB_MULTIPLE
* flags specified will return additional key and data
* pairs or
* Db.DB_NOTFOUND if there are no
* additional key and data items to return.
* * In the case of Btree or Hash databases, the multiple key * and data pairs can be iterated over using the {@link * com.sleepycat.db.DbMultipleKeyDataIterator * DbMultipleKeyDataIterator} class.
* * In the case of Queue or Recno databases, the multiple * record number and data pairs can be iterated over using * the {@link com.sleepycat.db.DbMultipleRecnoDataIterator * DbMultipleRecnoDataIterator} class.
*
* The buffer to which the data parameter refers
* must be provided from user memory (see {@link
* com.sleepycat.db.Db#DB_DBT_USERMEM Db.DB_DBT_USERMEM
* }). The buffer must be at least as large as the page
* size of the underlying database, aligned for unsigned
* integer access, and be a multiple of 1024 bytes in size.
* If the buffer size is insufficient, then upon return
* from the call the size field of the data
* parameter will have been set to an estimated buffer
* size, and a {@link com.sleepycat.db.DbMemoryException
* DbMemoryException} is thrown. (The size is an estimate
* as the exact size needed may not be known until all
* entries are read. It is best to initially provide a
* relatively large buffer, but applications should be
* prepared to resize the buffer as necessary and
* repeatedly call the method.)
*
* The Db.DB_MULTIPLE_KEY flag may only be
* used with the Db.DB_CURRENT, Db.DB_FIRST
* , Db.DB_GET_BOTH, Db.DB_GET_BOTH_RANGE
* , Db.DB_NEXT, Db.DB_NEXT_DUP,
* Db.DB_NEXT_NODUP, Db.DB_SET,
* Db.DB_SET_RANGE, and Db.DB_SET_RECNO
* options. The Db.DB_MULTIPLE_KEY flag may
* not be used when accessing databases made into secondary
* indices using the {@link com.sleepycat.db.Db#associate
* Db.associate} method.
* * Acquire write locks instead of read locks when doing the * retrieval. Setting this flag can eliminate deadlock * during a read-modify-write cycle by acquiring the write * lock during the read part of the cycle so that another * thread of control acquiring a read lock for the same * item, in its own read-modify-write cycle, will not * result in deadlock.
*
* The Dbc.get method will return
* Db.DB_KEYEMPTY if Db.DB_CURRENT
* is set and the cursor key/data pair was deleted.
*
* The Dbc.get method will return
* Db.DB_NOTFOUND if Db.DB_FIRST
* is set and the database is empty.
*
* The Dbc.get method will return
* Db.DB_NOTFOUND if Db.DB_LAST
* is set and the database is empty.
*
* The Dbc.get method will return
* Db.DB_NOTFOUND if Db.DB_NEXT
* is set and the cursor is already on the last record in
* the database.
*
* The Dbc.get method will return
* Db.DB_NOTFOUND if Db.DB_NEXT_DUP
* is set and the next key/data pair of the database is not
* a duplicate data record for the current key/data pair.
*
*
* The Dbc.get method will return
* Db.DB_NOTFOUND if Db.DB_NEXT_NODUP
* is set and no non-duplicate key/data pairs occur after
* the cursor position in the database.
*
* The Dbc.get method will return
* Db.DB_NOTFOUND if Db.DB_PREV
* is set and the cursor is already on the first record in
* the database.
*
* The Dbc.get method will return
* Db.DB_NOTFOUND if Db.DB_PREV_NODUP
* is set and no non-duplicate key/data pairs occur before
* the cursor position in the database.
*
* The Dbc.get method will return
* Db.DB_NOTFOUND if Db.DB_SET
* is set and no matching keys are found.
*
* The Dbc.get method will return
* Db.DB_KEYEMPTY if Db.DB_SET
* is set and the database is a Queue or Recno database,
* and the specified key exists, but was never explicitly
* created by the application or was later deleted.
*
* In the case of the Btree and Hash access methods, insert
* the data element as a duplicate element of the key to
* which the cursor refers. The new element appears
* immediately after the current cursor position. It is an
* error to specify Db.DB_AFTER if the
* underlying Btree or Hash database does not support
* duplicate data items. ignored.
*
* In the case of the Recno access method, it is an error
* to specify Db.DB_AFTER if the underlying
* Recno database was not created with the {@link
* com.sleepycat.db.Db#DB_RENUMBER Db.DB_RENUMBER
* } flag. If the {@link com.sleepycat.db.Db#DB_RENUMBER
* Db.DB_RENUMBER} flag was specified, a new
* key is created, all records after the inserted item are
* automatically renumbered, and the key of the new record
* is returned in the structure to which the key
* parameter refers. The initial value of the key
* parameter is ignored. See {@link
* com.sleepycat.db.Db#open Db.open} for more information.
*
*
* The Db.DB_AFTER flag may not be specified
* to the Queue access method.
*
* In the case of the Btree and Hash access methods, insert
* the data element as a duplicate element of the key to
* which the cursor refers. The new element appears
* immediately before the current cursor position. It is an
* error to specify Db.DB_BEFORE if the
* underlying Btree or Hash database does not support
* duplicate data items. ignored.
*
* In the case of the Recno access method, it is an error
* to specify Db.DB_BEFORE if the underlying
* Recno database was not created with the {@link
* com.sleepycat.db.Db#DB_RENUMBER Db.DB_RENUMBER
* } flag. If the {@link com.sleepycat.db.Db#DB_RENUMBER
* Db.DB_RENUMBER} flag was specified, a new
* key is created, the current record and all records after
* it are automatically renumbered, and the key of the new
* record is returned in the structure to which the key
* parameter refers. The initial value of the key
* parameter is ignored. See {@link
* com.sleepycat.db.Db#open Db.open} for more information.
*
*
* The Db.DB_BEFORE flag may not be specified
* to the Queue access method.
* * Overwrite the data of the key/data pair to which the * cursor refers with the specified data item. ignored. *
* * In the case of the Btree and Hash access methods, insert * the specified key/data pair into the database.
* * If the underlying database supports duplicate data * items, and if the key already exists in the database and * a duplicate sort function has been specified, the * inserted data item is added in its sorted location. If * the key already exists in the database and no duplicate * sort function has been specified, the inserted data item * is added as the first of the data items for that key. *
*
* The Db.DB_KEYFIRST flag may not be
* specified to the Queue or Recno access methods.
* * In the case of the Btree and Hash access methods, insert * the specified key/data pair into the database.
* * If the underlying database supports duplicate data * items, and if the key already exists in the database and * a duplicate sort function has been specified, the * inserted data item is added in its sorted location. If * the key already exists in the database, and no duplicate * sort function has been specified, the inserted data item * is added as the last of the data items for that key.
*
*
* The Db.DB_KEYLAST flag may not be specified
* to the Queue or Recno access methods.
*
* In the case of the Btree and Hash access methods, insert
* the specified key/data pair into the database, unless a
* key/data pair comparing equally to it already exists in
* the database. If a matching key/data pair already exists
* in the database, {@link com.sleepycat.db.Db#DB_KEYEXIST
* Db.DB_KEYEXIST} is returned. The Db.DB_NODUPDATA
* flag may only be specified if the underlying database
* has been configured to support sorted duplicate data
* items.
*
* The Db.DB_NODUPDATA flag may not be
* specified to the Queue or Recno access methods.
*
* The Dbc.put method will return
* Db.DB_NOTFOUND if the current cursor
* record has already been deleted and the underlying
* access method is Hash.
*
* The Dbc.put method will return
* Db.DB_NOTFOUND if the current cursor
* record has already been deleted and the underlying
* access method is Hash.
*
* The Dbc.put method will return
* Db.DB_NOTFOUND if the current cursor
* record has already been deleted and the underlying
* access method is Hash.