Set the busy timeout delay for a database connection


#include <qdb/qdb.h>

int qdb_setbusytimeout( qdb_hdt_t *hdl,
                        int timeout );


A pointer to the database handle to set the timeout for.
The timeout delay, in ms. This value may also be:
  • QDB_TIMEOUT_NONBLOCK — the equivalent of a 0 timeout. This means that calls to qdb_statement() return immediately with failure if the database file is locked.
  • QDB_TIMEOUT_BLOCK — the equivalent of an infinite timeout period. Calls to qdb_statement() will wait forever, or until the database is unlocked and the call succeeds.




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().)


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


QNX Neutrino

Interrupt handler No
Signal handler No
Thread Yes