DbEnv::set_timeout API Ref

#include <db_cxx.h>

int DbEnv::set_timeout(db_timeout_t timeout, u_int32_t flags);

int DbEnv::get_timeout(db_timeout_t *timeoutp, u_int32_t flag);


Description: DbEnv::set_timeout

The DbEnv::set_timeout method sets timeout values for locks or transactions in the database environment.

All timeouts are checked whenever a thread of control blocks on a lock or when deadlock detection is performed. (In the case of DB_SET_LOCK_TIMEOUT, the lock is one requested explicitly through the Lock subsystem interfaces. In the case of DB_SET_TXN_TIMEOUT, the lock is one requested on behalf of a transaction. In either case, it may be a lock requested by the database access methods underlying the application.) As timeouts are only checked when the lock request first blocks or when deadlock detection is performed, the accuracy of the timeout depends on how often deadlock detection is performed.

Timeout values specified for the database environment may be overridden on a per-lock or per-transaction basis. See DbEnv::lock_vec and DbTxn::set_timeout for more information.

The DbEnv::set_timeout method configures a database environment, not only operations performed using the specified DbEnv handle.

The DbEnv::set_timeout method may be called at any time during the life of the application.

The DbEnv::set_timeout 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
flags

Errors

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


EINVAL

Description: DbEnv::get_timeout

The DbEnv::get_timeout method returns a timeout value, in microseconds.

The DbEnv::get_timeout method may be called at any time during the life of the application.

The DbEnv::get_timeout 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
flag timeoutp


Class DbEnv
See Also Database Environments and Related Methods

APIRef

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