qdb_gettransstate()

Return the transaction state for a QDB connection

Synopsis:

#include <qdb/qdb.h>

int qdb_gettransstate(qdb_hdl_t *hdl);

Arguments:

hdl
A pointer to the database handle.

Library:

qdb

Description:

This function returns the transaction state for the current QDB connection. If the connection is in an SQL transaction, this function returns 1. If the connection is not in an SQL transaction, 0 is returned. If there's an SQL error, -1 is returned (you can use qdb_geterrmsg() to get the error string).

You can use this function to determine how to clean up after an SQL error; for example, when you execute several commands including a transaction and need to determine which statement caused the error.

Returns:

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

Classification:

QNX Neutrino

Safety:  
Interrupt handler No
Signal handler No
Thread Yes