ee,hash,hashing,transaction,transactions,locking,logging,access method,access me thods,java,C,C++">
import com.sleepycat.db.*;public void set_flags(int flags);
The following additional flags may be specified for the Btree access method:
Specifying that duplicates are to be sorted changes the behavior of the
Db.put operation as well as the Dbc.put operation when
the Db.DB_KEYFIRST, Db.DB_KEYLAST and Db.DB_CURRENT
flags are specified.
Logical record numbers in btrees are mutable in the face of record
insertion or deletion.
See the DB_RENUMBER flag in the Recno access method information for
further discussion.
Maintaining record counts within a btree introduces a serious point of
contention, namely the page locations where the record counts are stored.
In addition, the entire tree must be locked during both insertions and
deletions, effectively single-threading the tree for those operations.
Specifying DB_RECNUM can result in serious performance degradation for
some applications and data sets.
It is an error to specify both DB_DUP and DB_RECNUM.
The following additional flags may be specified for the Hash access method:
Specifying that duplicates are to be sorted changes the behavior of the Db.put operation as well as the Dbc.put operation when the Db.DB_KEYFIRST, Db.DB_KEYLAST and Db.DB_CURRENT flags are specified.
The following additional flags may be specified for the Recno access method:
Any records added to the database that are less than re_len bytes long are automatically padded. Any attempt to insert records into the database that are greater than re_len bytes long will cause the call to fail immediately and return an error.
Using the Db.put or Dbc.put interfaces to create new records will cause the creation of multiple records if the record number is more than one greater than the largest record currently in the database. For example, creating record 28, when record 25 was previously the last record in the database, will create records 26 and 27 as well as 28. Attempts to retrieve records that were created in this manner will result in an error return of DB_KEYEMPTY.
If a created record is not at the end of the database, all records following the new record will be automatically renumbered upward by 1. For example, the creation of a new record numbered 8 causes records numbered 8 and greater to be renumbered upward by 1. If a cursor was positioned to record number 8 or greater before the insertion, it will be shifted upward 1 logical record, continuing to reference the same record as it did before.
For these reasons, concurrent access to a recno database with the DB_RENUMBER flag specified may be largely meaningless, although it is supported.