qdb_setbusytimeout()

Set the busy timeout delay for a database connection

Synopsis:

#include <qdb/qdb.h>

int qdb_setbusytimeout( qdb_hdt_t *hdl,
                        int timeout );

Arguments:

hdl
A pointer to the database handle to set the timeout for.
timeout
The timeout delay, in ms. This value may also be:

Library:

qdb

Description:

This function sets the busy timeout delay for the database connection specified by hdl. The initial value is specified on the qdb commandline with the -t option, with a default of 5000 ms. Specifying a value of 0 is the same as QDB_TIMEOUT_NONBLOCK.

The timeout is the amount of time that a client will attempt to access a database before it returns EBUSY. If two clients attempt to write to the database, for example, the database is locked while the first client is writing, and the second client's attempt will fail if the busy timeout period expires.


Note: The QDB_CONN_NONBLOCKING flag bit is affected by the timeout value. If you set or toggle QDB_CONN_NONBLOCKING, the busy timeout value itself is set to 0 or back to the -t default. Similarly, if you set the timeout to be QDB_TIMEOUT_NONBLOCK, the QDB_CONN_NONBLOCKING bit is set.

(The QDB_CONN_NONBLOCKING flag bit is set with qdb_connect() and toggled with qdb_parameters().)


Returns:

0
Success. The previous busy timeout setting is returned.
-1
An error occurred (errno is set).

Classification:

QNX Neutrino

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

qdb_connect(), qdb_parameters(), qdb_statement()