Db::set_h_hash API Ref

#include <db_cxx.h>

extern "C" { typedef u_int32_t (*h_hash_fcn_type) (DB *, const void *bytes, u_int32_t length); }; int Db::set_h_hash(h_hash_fcn_type h_hash_fcn);


Description: Db::set_h_hash

Set a user-defined hash function; if no hash function is specified, a default hash function is used. Because no hash function performs equally well on all possible data, the user may find that the built-in hash function performs poorly with a particular data set.

The Db::set_h_hash method configures operations performed using the specified Db handle, not all operations performed on the underlying database.

The Db::set_h_hash method may not be called after the Db::open method is called. If the database already exists when Db::open is called, the information specified to Db::set_h_hash must be the same as that historically used to create the database or corruption can occur.

The Db::set_h_hash method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

Parameters
h_hash_fcn

Errors

The Db::set_h_hash method may fail and throw DbException, encapsulating one of the following non-zero errors, or return one of the following non-zero errors:


EINVAL


Class Db
See Also Databases and Related Methods

APIRef

Copyright (c) 1996,2008 Oracle. All rights reserved.