Interrupt a long-running query


#include <qdb/qdb.h>

int qdb_interrupt(qdb_hdl_t *db);


A pointer to the database handle.




This function interrupts all currently running queries that are using the specified connection handle, and rolls back any uncommitted transactions. If qdb_interrupt() is called on a connection where no query is executing, it does nothing.

If the connection to QDB is synchronous, this function must be called from a separate thread from the one that initiated the query. In asynchronous mode, this function may be called from the same thread.

If a query is nearly finished at the time when qdb_interrupt() is called, then it might not have an opportunity to be interrupted and might continue to completion.

The qdb_interrupt() call is in effect until all currently running queries using the specified connection handle complete or are successfully interrupted. Any queries that are started after the qdb_interrupt() call and before the number of currently running queries reaches zero are interrupted as if they had been running prior to the qdb_interrupt() call. New queries that are started after the count of currently running queries reaches zero are not effected by qdb_interrupt().

Caution: Care should be taken to ensure that the connection to QDB is not disconnected while this call is running, otherwise the database may be left in an inconsistent state.


An error occurred (errno is set).


QNX Neutrino

Interrupt handler No
Signal handler No
Thread Yes

See also:

qdb_query(), qdb_rollback()