qdb_gettransstate()

Return the transaction state for a database connection

Synopsis:

#include <qdb/qdb.h>

int qdb_gettransstate( qdb_hdl_t *db );

Arguments:

db
A pointer to the database handle.

Library:

qdb

Description:

This function returns the transaction state for the specified database connection. If an SQL transaction is in progress over the connection, the function returns 1. If no SQL transaction is happening, 0 is returned. If there's an SQL error, -1 is returned (and you can use qdb_geterrmsg() to get the error string).

You can call qdb_gettransstate() to determine how to clean up after an SQL error; for example, if you execute several commands in a transaction and need to determine which statement is causing the error.

Returns:

1
An SQL transaction is in progress.
0
No SQL transaction is in progress.
-1
An SQL error occurred (errno is set).

Classification:

QNX Neutrino

Safety:  
Interrupt handler No
Signal handler No
Thread Yes