qdb_interrupt()

Interrupt long-running queries

Synopsis:

#include <qdb/qdb.h>

int qdb_interrupt( qdb_hdl_t *db );

Arguments:

db
A pointer to the database handle.

Library:

qdb

Description:

This function interrupts all currently running queries that are using the specified database connection handle, then rolls back any uncommitted transactions. If qdb_interrupt() is called on a connection when no query is executing, it doesn't do anything.

If the database connection is synchronous, you must call this function in a thread other than the one that initiated the query. In asynchronous mode, this function may be called from the same thread.

If a query is nearly finished when you call this function, the query might not get interrupted and instead finish executing.

The qdb_interrupt() call is active until all currently running queries associated with the specified handle either finish executing or are successfully interrupted. For queries started after the qdb_interrupt() call was issued but before the count of active queries reaches 0, they're interrupted as if they had been running prior to the call. Any queries started after the active query count reaches 0 aren't affected by this function.

CAUTION:
You must not disconnect from the database while this call is still active; otherwise, the database may end up in an inconsistent state.

Returns:

0
Success.
-1
An error occurred (errno is set).

Classification:

QNX Neutrino

Safety:  
Interrupt handler No
Signal handler No
Thread Yes