DbTxn::set_timeout API Ref

#include <db_cxx.h>

u_int32_t DbTxn::set_timeout(db_timeout_t timeout, u_int32_t flags);


Description: DbTxn::set_timeout

The DbTxn::set_timeout method sets timeout values for locks or transactions for the specified transaction.

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 timeout is for any single lock request. In the case of DB_SET_TXN_TIMEOUT, the timeout is for the life of the transaction. 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 may be specified for the database environment as a whole. See DbEnv::set_timeout and for more information.

The DbTxn::set_timeout method configures operations performed on the underlying transaction, not only operations performed using the specified DbTxn handle.

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

The DbTxn::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 timeout

Errors

The DbTxn::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


Class DbEnv, DbTxn
See Also Transaction Subsystem and Related Methods

APIRef

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